Date literals

Peter Michaux petermichaux at gmail.com
Tue Nov 18 22:02:32 PST 2008


All the data types in ES3 listed in section 15 have literals version
(e.g. {} for Object, [] for Array etc) except for Date. Is there any
reason that the Kona 15.9.1.15 "Date Time string format" could not be
a literal form for date objects?

YYYY-MM-DDTHH:mm:ss.sssTZ

The 'T' in the middle makes this identifiable as a date literal
similar to how the 'e' or 'E' of an exponential number literal works.

It would be beneficial to have a date literal as then a JSON object
could have date literal values and still be parsed quickly with eval.

Peter


More information about the Es-discuss mailing list