标签:
//将字符串转反序列化为json格式的数组
JSON.parse([{"name":"zhangsan","sex":"nan"},{"name":"lisi","sex":"nan"}]);
//定义一组对象数组
var json=[{"name":"zhangsan","sex":"nan"},{"name":"lisi","sex":"nan"}];
//向数组中添加对象
json.push({"name":"haha","sex":"nv"});
//删除数组中指定下标的对象,0代表下标,1代表删除几位
json.splice(0,1);
//将数组序列化为字符串
JSON.stringify(json);
标签:
原文地址:http://www.cnblogs.com/zhhying/p/4243495.html