array.findLastIndex(callback)

Benchmark created on


Description

find the last element index matched callback execution result in array

Setup

const array = new Array(1000).fill(1).map((_, i) => i + 1)

Test runner

Ready to run.

Testing in
TestOps/sec
reverse + findIndex
const lastDivisible7 = [...array].reverse().findIndex(number => number % 7 === 0);
ready
findLastIndex
const lastDivisible7 = array.findLastIndex(number => number % 7 === 0);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.