Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Testing for false vs === undefined vs hasOwnProperty for undefined member
Is there a performance benefit to replacing === undefined with a logical test?
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0
Browser:
Firefox 122
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
test truth
1663117568.0 Ops/sec
test undefined
1655027712.0 Ops/sec
test hasOwnProperty
1655445120.0 Ops/sec
Tests:
test truth
var n = {}; while(true) { if(!n.foo) break; }
test undefined
var n = {}; while(true) { if(n.foo===undefined) break; }
test hasOwnProperty
var n = {}; while(true) { if(!n.hasOwnProperty('foo')) break; }