Array.contains Function
Determines whether the specified object exists as an element in an Array object. This function is static and can be invoked without creating an instance of the object.
var itemExists = Array.contains(array, item);
Use the contains function to determine whether a specified object exists as element in an Array object.
In Mozilla Firefox, calling the contains function with item set to undefined returns true if an item in the array has been set to undefined. In all other browsers, the function returns false in these circumstances.
Show: