Default argument (v2)

Revision 2 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 = a();
ready
With null-check
function def(a) {
	return a ? a.filter(Boolean) : [];
}

var b = a();
ready

Revisions

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