Array.prototype.findIndex

Returns the index of the first element in the array where predicate is true, and -1 otherwise.

Syntax

findIndex(predicate, thisArg?)

Return value

An index or -1 if the element is not found.

Parameters