array.find vs array.findIndex (v2)

Revision 2 of this benchmark created on


Setup

var arr = [];
var i = 0;

while (i <= 1E5) arr[i] = i++;

Test runner

Ready to run.

Testing in
TestOps/sec
find
const item = arr.find(item => item == 1E5);
ready
findIndex
const index = arr.findIndex(item => item == 1E5);
ready

Revisions

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