Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
isNaN vs Number.isNaN vs Object.is
(version: 1)
Comparing performance of:
isNaN vs Number.isNaN vs Object.is
Created:
one year ago
by:
Registered User
Jump to the latest result
Script Preparation code:
var num = Array(100).fill(0).map(v => Math.random() < 0.2 ? NaN : Math.random());
Tests:
isNaN
num.map(v => isNaN(v));
Number.isNaN
num.map(v => Number.isNaN(v))
Object.is
num.map(v => Object.is(v, NaN));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
isNaN
Number.isNaN
Object.is
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:144.0) Gecko/20100101 Firefox/144.0
Browser/OS:
Firefox 144 on Mac OS X 10.15
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
isNaN
2542527.2 Ops/sec
Number.isNaN
803541.2 Ops/sec
Object.is
703898.8 Ops/sec
Related benchmarks:
Arguments as array: spread vs apply
Reflect.set vs Object.assign vs Direct assignment
.at vs [x]
Checking numbers (non signed integers): "Number.isFinite()" vs "!== null" (equal to null)
at 500 vs [500]
.at vs [x] (with last)
Math.pow(x, 2) vs. x * x
Some vs. includes ABCX
unique set or object
Comments
Confirm delete:
Do you really want to delete benchmark?