for-of (v3)

Revision 3 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
for-of
const arr = new Array(1e7).fill(0);
const res = [];
for (let value of arr) {
	res.push(value);
}
ready
map
const arr = new Array(1e7).fill(0);
arr.map((x) => x);
ready
forEach
const arr = new Array(1e7).fill(0);
const res = [];
arr.forEach((value) => {
	res.push(value);
});
ready

Revisions

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