function call formats

Benchmark created on


Setup

function args(arg1, arg2, arg3) {
	return arg1 + arg2 + arg3;
}

function obj({arg1, arg2, arg3}) {
	return arg1 + arg2 + arg3;
}


function arr([arg1, arg2, arg3]) {
	return arg1 + arg2 + arg3;
}


function argslong(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) {
	return arg1 + arg2 + arg3;
}

Test runner

Ready to run.

Testing in
TestOps/sec
argument list
let value = args(1, 2, 3);
ready
object destructuring
let value = obj({ arg1: 1, arg2: 2, arg3: 3});
ready
array destructuring
let value = arr([1, 2, 3]);
ready
argument list (long)
let value = argslong(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
ready

Revisions

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