js the JSON.stringify object serialization () and deserialize the JSON.parse ()

draft:

configured to parse a parse string from json objects, such as

var str = '{"name":"huangxiaojian","age":"23"}'

result:

JSON.parse(str)

 

Object
  1. age"23"
  2. name"huangxiaojian"
  3. __proto__Object

 


Note: Single quotes written on {} In addition, each property name must be enclosed in double quotes, otherwise it will throw an exception.


the stringify () to parse the string from an object, such as

There are a = {a 1, b 2}

result:

JSON.stringify(a)

"{"a":1,"b":2}"

Reproduced in: https: //www.cnblogs.com/jimmy-c/p/4739603.html

Guess you like

Origin blog.csdn.net/weixin_33705053/article/details/93611041