For Loop vs Map

Benchmark created on


Description

Which is faster - the for loop or map

Test runner

Ready to run.

Testing in
TestOps/sec
For loop
function loop(arr) {
	for (let i=0; i<arr; i++) {
		console.log("i", i)
	}
}
ready
Map
function loop(arr) {
	arr.map(a=> console.log("i", i))
}
ready

Revisions

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