truthy vs typeof

Benchmark created on


Setup

const obj = {};

Test runner

Ready to run.

Testing in
TestOps/sec
truthy
if (obj) {
	
}
ready
typeof
if (typeof obj !== 'undefined') {
	
}
ready

Revisions

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