js-test-for-vs-foreach

Benchmark created on


Description

for vs foreach

Test runner

Ready to run.

Testing in
TestOps/sec
for
const list = ['1','2','3','4','5','6','7']
for(let i = 0;i<= i.length;i++){
	console.log(list[i])
}
ready
foreach
const list = ['1','2','3','4','5','6','7']
list.forEach((item) => {
	console.log(item)
})
ready

Revisions

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