includes() method. The
includes() method determines whether an array includes a certain element, returning as a Boolean.
- The element you are looking for in the array.
- The array index of the current element at which to begin searching for the findElement.
The return value is a Boolean, which returns true if the value of the element was found, and false if it was not found.
Things to consider
- If the
fromIndexvalue is negative, the search starts from the index of
array.length - fromIndexby asc.
fromIndexis greater than or equal to the length of the array,
falseis returned. The array will not be searched.