Test name | Executions per second |
---|---|
Array.prototype.find | 795.7 Ops/sec |
Array.prototype.findIndex | 768.3 Ops/sec |
var arr = [];
var i = 0;
while (i <= 1E5) arr[i] = i++;
const item = arr.find(item => item == 1E5);
const index = arr.findIndex(item => item == 1E5);