Skip to content

Comment on Stupid Languagesparent

Comments

Number(x) performs a type conversion to number, new Number(x) constructs a primitive wrapper object Number:

  typeof Number("10")
  //=> "number"
  typeof new Number("10")
  //=> "object"
The same applies to other wrapper objects, that is, Boolean and String.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.