spread vs arguments

Benchmark created on


Setup

const arr = [10,20,30,40]

Test runner

Ready to run.

Testing in
TestOps/sec
spread
function join(...args) {
	return args[0] + args[1] + args[2] + args[3]
}
join(...arr)
ready
arguments
function join(a1, a2, a3, a4) {
	return a1 + a2 + a3 + a4
}

join(arr)
ready

Revisions

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