Default argument (v3)

Revision 3 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Default argument
function def(a = []) {
	return a.filter(Boolean);
}

var b = def();
ready
With null-check
function nc(a) {
	return a ? a.filter(Boolean) : [];
}

var b = nc();
ready

Revisions

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