Test name | Executions per second |
---|---|
for | 1113086.2 Ops/sec |
foreach | 7774142.0 Ops/sec |
some | 8024748.0 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];
});