Up until ES 3 you need to quote reserved words of the language (new, default, class, etc.). In the new version, however, this will be unnecessary.
But since ES 5 is not well-supported yet, you need to stick with quoting all reserved words.
If you don't want to memorize the full list of words, you better off with quoting everything.
Extra: this is why you don't have float
and class
properties on an element. You have to use cssFloat/styleFloat
and className
instead.
Another addition is that you need to quote every key in a JSON string. The reason is because they wanted it to be language independent, in order not to interfere with stupid restrictions like the one in ES3.