Loop

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
For loop
const arr = Array(10000).fill('loop')

for (let i = 0; i < arr.length; i++) {
	console.log(arr[i])
}
ready
Array.forEach
const arr = Array(10000).fill('loop')

arr.forEach(function (item) {
	console.log(item)
})
ready
Array.map
const arr = Array(10000).fill('loop')

arr.map(function (item) {
	console.log(item)
})
ready

Revisions

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