Knowledgize

.indexOf()

Returns the first index at which a given element can be found in the array, or -1 if it is not present.

Examples:

let fruits = ['apple', 'banana', 'orange', 'banana']; let index = fruits.indexOf('banana'); console.log(index); // 1
index = fruits.indexOf('mango'); console.log(index); // -1