parse is used to parse a json object from a string, such as
var str = '{"name":"huangxiaojian","age":"23"}'
result:
JSON.parse(str)
Object
- age: "23"
- name: "huangxiaojian"
- __proto__: Object
Note: Single quotes are written outside {}, and each attribute name must be double quoted, otherwise an exception will be thrown.
stringify() is used to parse a string from an object, such as
var a = {a:1,b:2}
result:
JSON.stringify(a)
"{"a":1,"b":2}"