Arrayprototypeincludes
Array.prototype.includes is a method of the JavaScript Array prototype that determines whether an array contains a given element, returning true or false. It was introduced in the ECMAScript 2016 standard and is widely supported in contemporary environments.
The method has the signature includes(searchElement[, fromIndex]). The fromIndex parameter is optional and defaults to 0.
Examples illustrate common usage: [1, 2, 3].includes(2) returns true, while [1, 2, 3].includes(4) returns false. [NaN].includes(NaN)
Notes and compatibility: includes is primarily used on actual arrays but can be borrowed by array-like objects.