Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
falsy vs typeof
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Browser:
Chrome 131
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
falsy
19624168.0 Ops/sec
typeof
307058.2 Ops/sec
Script Preparation code:
let a = null let b = null
Tests:
falsy
let a = undefined let b = null if (a) console.log('-') if (b) console.log('-')
typeof
let a = undefined let b = null if (typeof a === 'undefined') console.log('-') if (typeof b === 'undefined') console.log('-')