es6-for of

Benchmark created on


Setup

const arr = [1, 2, 3, 4, 5]; 

Test runner

Ready to run.

Testing in
TestOps/sec
for of
for (const num of arr) {  
  const result = num * 2;  
}
ready
for循环
for (let i = 0; i < arr.length; i++) {  
  const result = arr[i] * 2;  
}
ready

Revisions

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