Manual check vs Default parameter

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Manual check
const a = (b) =>{
	if (!b) { b = {} }
	const c = b.toString()
}

a()
a({})
a({ d: 1 })
ready
Default parameter
const a = (b = {}) =>{
	const c = b.toString()
}

a()
a({})
a({ d: 1 })
ready

Revisions

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