Create array_index_value.html



The $.inArray() method is similar to JavaScript's native .indexOf() method in that it returns -1 when it doesn't find a match. If the first element within the array matches value, $.inArray() returns 0.
jQuery.inArray( value, array [, fromIndex ] )


    value
    Type: Anything
    The value to search for.
    array
    Type: Array
    An array through which to search.
    fromIndex
    Type: Number
    The index of the array at which to begin the search.The default is 0, which will search the whole array.


Because JavaScript treats 0 as loosely equal to false (i.e. 0 == false, but 0 !== false), if we're checking for the presence of value within array, we need to check if it's not equal to (or greater than) -1.