Array.findLastIndex(callback) (v2)

Revision 2 of this benchmark created on


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
findLast()
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.