For vs ForEach

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
forEach
const fruits = ['mela', 'pera', 'arancia', 'mandarino', 'banana'];

fruits.forEeach((fruit) => console.log(fruit)) 
ready
for of
const fruits = ['mela', 'pera', 'arancia', 'mandarino', 'banana'];

for(let fruit of fruits) {
	console.log(fruit)
}
ready

Revisions

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