Try...Catch vs Return

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Try..Catch
function handler(){
	try {
		throw new Error()
	}catch(e){
		return { status: 500, body: 'error'}
	}
}

handler();
ready
return value directly
function handler(){
 return { status: 500, body: 'error'}
}

handler();
ready

Revisions

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