Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
typeof vs boolean for obj
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:122.0) Gecko/20100101 Firefox/122.0
Browser:
Firefox 122
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
2 years ago
boolean
1567.7M/s
typeof
1564.6M/s
dnegation
1563.3M/s
View exact numbers
Test name
Executions per second
✓
boolean
1,567,691,648 Ops/sec
typeof
1,564,557,184 Ops/sec
dnegation
1,563,341,952 Ops/sec
Script Preparation code:
var obj = {hello: "world"};
Tests:
boolean
Boolean(obj)
typeof
typeof obj === 'object'
dnegation
!!obj