includes Example

.includes() Example

The general syntax for this method is:

arrayName.includes(item)

This method checks if an array contains the item specified in the parentheses (), and returns true or false.

Example
let charles = [1, 7, 5, 9, 5];
let otherArr = ['hello', 'world!'];

console.log(charles.includes(5));

console.log(otherArr.includes('hi'));

Output

true
false