Arrow functions vs function key word performance

Benchmark created on


Description

Comparison of performance of functions defined w/ function key word vs arrow functions

Test runner

Ready to run.

Testing in
TestOps/sec
function key word usage
let a = []

for (let i = 0; i < 100000; i++) {
	a.push = function () {
		console.log(`running ${i}`)
	}
}

for (method of a) {
	method()
}
ready
Arrow function usage
let a = []

for (let i = 0; i < 100000; i++) {
	a.push = () => {
		console.log(`running ${i}`)
	}
}

for (method of a) {
	method()
}
ready

Revisions

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