February 2018
Intermediate to advanced
298 pages
8h 22m
English
The findIndex() method is similar to the find() method. The findIndex() method returns the index of the satisfied array element instead of the element itself. Take a look at this example:
const x = 12;const arr = [11, 12, 13];const result = arr.findIndex( (value, index, array) => value == x );console.log(result);
The output is 1.
Read now
Unlock full access