includes() method determines if an element exists in an array.
syntax ↴
includes(element, start) ↴
element The value to search for.
start (optional). Start position at which to start searching.
Negative start position counts back from the end of the array.
includes() method returns true if an array contains a specified element.
includes() method returns false if the element is not found.
includes() method is case sensitive.
includes() method when used on sparse arrays, iterates empty slots as if they have the value undefined.
myArray.includes(element)
myArray.includes(element, start)