JavaScript array.includes() Function

JavaScript Logo

array.includes() – Determines whether the array contains a certain value, using `SameValueZero` for comparison.

๐Ÿ‘‰ Syntax

bool = array.includes(valueToFind[, fromIndex]);

๐Ÿงช Example

console.log(['a','b'].includes('b')); // true

Comments