Returns a Boolean value that indicates whether a given object is present in the array.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
An object to look for in the array.
an is present in the array, otherwise
Starting at index
0, each element of the array is checked for equality with
an until a match is found or the end of the array is reached. Objects are considered equal if
To determine if the array contains a particular instance of an object, you can test for identity rather than equality by calling the
index method and comparing the return value to