Oliver Hunt (2013-10-09T16:46:39.000Z)
domenic at domenicdenicola.com (2013-10-14T02:16:34.679Z)
On Oct 9, 2013, at 1:35 AM, Claude Pache <claude.pache at gmail.com> wrote: > Even if there had been a dedicated syntax to write literal dates in JS, it doesn't mean that JSON would have allowed such a representation. > For instance, the following entities have literal representation in JS, but do not exist in JSON, by the will of its designer: Infinity, NaN, and regular expressions. Infinity and NaN a identifiers referencing properties on the global object — they’re not literals (nor is undefined). These are all valid (but you shouldn’t do it): ```js function f(undefined, NaN, Infinity) { // dooooooommmmmm } function f() { var undefined = null /* fix that silly null vs. undefined shenanigans */, NaN = Math.sqrt(2) /* make sure nan is not rational */, Infinity = 10000000 /* this should be big enough */ } ```