Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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
Benchmark engine:
Benchmark.js
falsy
19.6M/s
typeof
307K/s
View exact numbers
Test name
Executions per second
✓
falsy
19,624,168 Ops/sec
typeof
307,058 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('-')