isNaN vs isFinite vs !== (v3)

Revision 3 of this benchmark created on


Setup

numsamples = [2, 2.2, 'a', '2', '2 3', 0x00eef]
    index = Math.floor(Math.random()*numsamples.length);
    this.input = numsamples[index]

Test runner

Ready to run.

Testing in
TestOps/sec
isNaN
!isNaN(this.input)
ready
isFinite
isFinite(this.input)
ready
typeof Number
typeof (this.input) === 'number'
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.