标签云

微信群

扫码加入我们

WeChat QR Code


There is no JSON there. Please don't confuse JavaScript objects with JSON.

2018年12月18日22分24秒

Quentin, thanks I'll read up on the difference between javacript objects and json (ref: stackoverflow.com/questions/6489783/…)

2018年12月18日22分24秒

Don't think it's a duplicate, the answer was not found on the other thread.

2018年12月17日22分24秒

Quentin, so it seems that if we were to talk purely within the scope of javascript, JSON and a Javascript Object are equivalent? JSON is different in that it's adaptable to the language used to interpret it?

2018年12月18日22分24秒

In the scope of JavaScript, JSON is either "A data format" or "An object containing methods to convert JavaScript objects to and from string representations of that data format"

2018年12月18日22分24秒

Does not work for functions, only properties (variables) within an object.

2018年12月18日22分24秒

JSON.stringify({key: undefined}) //=> "{}"

2018年12月18日22分24秒

With this, dates will be stringified and will remain strings even after parsed.

2018年12月17日22分24秒

Note that this will not work for objects with circular references.

2018年12月17日22分24秒

JSON.parse(JSON.stringify(object)) will cause all the dates changed to strings.

2018年12月18日22分24秒