map arrow vs function (v2)

Revision 2 of this benchmark created on


Setup

arr = new Array(1000).fill(null)

Test runner

Ready to run.

Testing in
TestOps/sec
const arrow
const iterator = (a,i) => i
arr.map(iterator)
ready
const func
const iterator = function (a,i) {
	return i
}
arr.map(iterator)
ready
arrow
arr.map((a,i) => i)
ready
func
arr.map(function (a,i) {
	return i
})
ready

Revisions

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