"JSON (JavaScript Object Notation) is a lightweight data interchange format. It is based on a subset of ECMAScript. Because of the language-independent text format, also used similar to the C language family habits, with these features make JSON an ideal data exchange language, the role is easy to read and write, but also easy to machine parsing and generation (generally used to improve network transmission rate). ”
1.parse is used to parse a JSON object from a string. For example
var str= ' {' name ': ' CPF ', ' age ': ' 23 '} '
obtained by Json.parse (str):
Object:age: "23"
Name: "CPF"
_proto_:object
PS: Single quotes are written outside {}, each attribute must be double-quoted, otherwise an exception will be thrown
2.stringify is used to parse out a string from an object, such as
var a={a:1,b:2}
Obtained by Json.stringify (a):
"{" A ": 1," B ": 2}"
Json.parse () and Json.stringify ()