js-array-beercss

Benchmark created on


Setup

const list = [];
for(let i=0; i<10000; i++) list.push(i);

Test runner

Ready to run.

Testing in
TestOps/sec
for of
for(let item of list) console.log(item);
ready
for i
for(let i=0; i<list.length; i++) console.log(list[i]);
ready
for i, n
for(let i=0, n=list.length; i<n; i++) console.log(list[i]);
ready
forEach
list.forEach(item => console.log(item));
ready

Revisions

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