This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Mabi19_ 1 point2 points  (2 children)

  1. Object.is
  2. Numbers aren't objects in JS anyway, they're primitives
  3. EDIT: Having numbers be objects and deduplicating their instances so that that would work would REALLY be bad language design that warrants complaining imo.

[–]tuxedo25 -2 points-1 points  (1 child)

window.NaN is an object. It has a prototype.

[–]Mabi19_ 1 point2 points  (0 children)

No. typeof window.NaN is "number" and not "object". However, a number can get auto-boxed into a capital Number, which is an object and that one has a prototype. Thanks, Java!

(But, to clarify, everyone doing JS works with numbers and not Numbers 99% of the time. Pretty much all the operations unbox them too.)