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

I think this wording is misleading:

> Everything in JavaScript acts like an object, with the only two exceptions being null and undefined.

The 'scalars' - string, number and boolean - only behaves like objects in the limited sense that you can apply the dot operator. But they are immutable primitive values, while all other objects are basically mutable dictionaries. So there is a big difference. For example the syntax seem to allows you to set a property on a scalar, but no property will not actually be set because there is no dictionary to hold the properties.




Yeah. I believe that false.toString() is "actually" something like (Boolean(false)).toString().




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

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

Search: