spread vs arguments (v2)

Revision 2 of this 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[0],arr[1],arr[2],arr[3])
ready

Revisions

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