ITeye博客

JSON.parse() & JSON.stringify()

fairy_xzc · 2017-01-10 14:16 · JavaScript · Web前端 · Markdown

原创转载请注明出处:http://agilestyle.iteye.com/blog/2352232

 

JSON.parse()

Demo

var str = '{"username":"nodejs", "password":"23"}';

console.log(JSON.parse(str));

Console Output


 

JSON.stringify()

Demo

var str = {a: 1, b: 2, c: "test"};

console.log(JSON.stringify(str));

Console Output

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。