
Lonely programmer detective uncovers the Mozilla JavaScript coercion conspiracy - luisperezphd
http://stackoverflow.com/a/38677222/984780
======
combatentropy
Something about how JavaScript coerces numbers to objects and back again,
filled with clickbaitesque sensationalist sentences. I stopped reading.

~~~
ubernostrum
Minus the writing style, explanation of a 'wat' in JS which turns out to be
the equivalent of boxing in Java/C# (behavior which looks odd and comes from
cases where the operations involved convert a primitive type to an instance of
its wrapper object type and back again).

------
buckbova
> Mozilla tried to bury by putting it where they knew nobody would look - the
> documentation.

If they really wanted to hide it, should have tried the EULA.

~~~
spicyj
The joke seems to be that the docs are exactly where you would expect to find
this info.

------
pc2g4d
I actually had no idea there was a difference between number values and number
objects. Definitely one of the more confusing areas of Javascript.

~~~
tracker1
Similarly, there is a String object for string values as well... Sometimes the
behavior can seem weird, but for the most part, it works.

------
devishard
shitty design != conspiracy

~~~
twic
The author of that answer does not actually think there is a conspiracy. He
has written a detailed explanation of what is happening in the form of a
lighthearted parody of a hard boiled detective thriller [1]. It's witty.

Someone who got it was Seth, who left the comment referencing the famous line
from the noir thriller 'Chinatown' [2].

[1]
[http://tvtropes.org/pmwiki/pmwiki.php/Main/HardboiledDetecti...](http://tvtropes.org/pmwiki/pmwiki.php/Main/HardboiledDetective)

[2] [https://www.quora.com/What-is-the-meaning-of-the-line-
Forget...](https://www.quora.com/What-is-the-meaning-of-the-line-Forget-it-
Jake-Its-Chinatown)

