31
Comments
  • 5
    There are reasons for that check out stack overflow.

    And the first 2 operations are painfully obvious.

    For later 2 DDG is there why not use it.
  • 3
    But it does make sense
  • 1
    What's the joke?
  • 1
    @rEaL-jAsE
    typeof NaN
    "number"
    makes sense.
    Really?!??

    Why?
  • 3
    @TylerDDevRant you use it in a function that has to return a number as a signal that the function failed/ not able to produce a number!
  • 2
    @mrsulfat
    And that's the daily JS mindfuck mindset.

    The creators of JS are some very unique flowers...
  • 2
    @TylerDDevRant guess what?
    They use the same logic in c and java!
  • 2
    @mrsulfat
    Oh. Ok.
    Thanks for this info!
    Mind == Blown

    ^^
  • 6
    Bullshit_rant_about_absultely_fine_as intended_js_functionality_by_noob_who doesn't_understand_what_it_does_#2340652

    For a simple example.
    Sqft(-1) and sqrt(-2) are both nan. Obviously not equal.

    typeof(nan) doesn't make a lick of sense to compare, because it's the type of a prototype. Not a value.
  • 0
  • 0
    I don't know anything about JS, but this makes perfect sense. Just learn about floating points please...
  • 0
    @TylerDDevRant the reason NaN is a number and not equal to itself is still and remains because of IEEE756 which is the floating point specification JS uses.

    And good lord, the reason !isNaN(NaN) returns false should be painfully obvious my dude
Add Comment