array.findLast(callback)

Benchmark created on


Description

find the last element 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 + find
const lastDivisible7 = [...array].reverse().find(number => number % 7 === 0);
ready
findLast
const lastDivisible7 = array.findLast(number => number % 7 === 0);
ready

Revisions

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