Test name | Executions per second |
---|---|
for | 55950.8 Ops/sec |
foreach | 2765283.5 Ops/sec |
some | 2949964.2 Ops/sec |
var array = new Array(100);
for (var i = 0; i < array.length; i++) {
array[i];
}
array.forEach(function(item, index) {
return item;
});
array.some(function(item, index) {
return item === array[index];
});