Check out example codes for "jquery check value exists in array". It will help you in understanding the concepts better.

Code Example 1

if ($.inArray('example', myArray) != -1)
{
  // found it
}

Learn ReactJs, React Native from akashmittal.com