array.contains()

Returns the position of the first element in the array that matches the item that we are searching for, or 0 if the item is not found.

array.contains( haystack, needle [, substringMatch ] )

Returns: Number

Argument Description
haystack
array, required

The array in which to search for the item

needle
object, required

The item that we are looking for in the array

substringMatch
boolean, optional

If set to true then if a then a substring match will also return true. This will only work with simple values. Passing true with complex objects will throw an exception.

Examples

There are currently no examples for this function

See also