Test name | Executions per second |
---|---|
Array.find | 13116.8 Ops/sec |
Array.indexOf | 12768.1 Ops/sec |
var arr = [];
var i = 0;
while (i <= 30000) arr[i] = i++;
const item = arr.find(item => item === 23000);
const index = arr.findIndex(item => item === 23000);