JSON.parse用于把jsonString转换成jsonObject:
var jsonString= '{"key":"value","key":"value"}'; var jsonObject = JSON.parse(jsonString); console.log(jsonObject); //输出:[object:Object]
JSON.stringify用于jsonObject转换成jsonString:
var jsonObejct = {"key":"value","key":"value"}; var jsonString = JSON.stringify(jsonObject); console.log(jsonString); //输出:'{"key":"value","key":"value"}'