Where
by Where
~1 min read

分类

一、JSON字符串转换为JSON对象

var str = '{ "name": "cxh", "sex": "man" }'
var obj = JSON.parse(str)

二、JSON对象转换为JSON字符串

var obj = { "name": "cxh", "sex": "man" }
var str = JSON.stringify(obj)