check if an jquery array exist code example
Example 1: jquery check value exists in array
if ($.inArray('example', myArray) != -1)
{
// found it
}
Example 2: jquery check if value is in array
$.inArray( 5 + 5, [ "8", "9", "10", 10 + "" ] );
if ($.inArray('example', myArray) != -1)
{
// found it
}
$.inArray( 5 + 5, [ "8", "9", "10", 10 + "" ] );