3 ms·
> JSON.parse("{\"date\":\"2014-03-02T16:08:43.444Z\"}") Object {date: "2014-03-02T16:08:43.444Z"}
by ollysb 13y ago
> JSON.parse("{\"date\":\"2014-03-02T16:08:43.444Z\"}")
Object {date: "2014-03-02T16:08:43.444Z"}
- TazeTSchnitzel 13y agoYes, but it is trivial to then convert it to a date with the new Date() constructor.
- byroot 13y agoBut it's not trivial to know that it's a date. It's ok if you are expecting a Date. But when you want to write generic code that "discover" the properties, then you have to do dirty things, like trying to parse every single strings as a date.