Hacker News new | past | comments | ask | show | jobs | submit login

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.



Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: