Loop performance

Benchmark created on


Setup

const limit = 45000

const arr = Array.apply(null, Array(limit))

Test runner

Ready to run.

Testing in
TestOps/sec
Loop
let count = 0

for (let i = 0; i < limit; i++) {
	count += 1
}

console.log(count)
ready
Array loop
let count = 0 

arr.forEach(() => count += 1)

console.log(count)
ready

Revisions

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