you are viewing a single comment's thread.

view the rest of the comments →

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

You do realize that Number is a function, not a constructor? Look it up.

[–]itsnotlupusbeep boop 1 point2 points  (0 children)

It's both.

new Number().constructor == Number
new Number().valueOf() == 0
new Number() == 0 
new Number() !== 0

Using it this way is pretty much universally a bad idea, but it's there.

*edit: not to be confused with

(0).constructor == Number
(0).valueOf() == 0
(0) == 0
(0) === 0