var data = [ {name: "王尼玛",sex:1,age: 30}, {name: "王尼美",sex:0,age: 20}, {name: "王大锤",sex:2,age: 30} ]; var str_json = JSON.stringify(data,function (k,v) { if (k === "sex") { return ["女","男","未知"][v]; } return v; }); console.log(str_json);
http://blog.csdn.net/wangxiaohu__/article/details/7254598原文链接:https://www.f2er.com/json/289431.html