1、删除json下指定的元素
var obj = {‘id’:1, ‘name’:2};
delete obj.id;
delete obj[id];
console.log(obj); // {‘name’:2}
2、删除数组中指定元素
var objArray = [‘1’,’2’,’3’,’4’];
objArray.remove(‘1’);
console.log(objArray); // [‘2’,’3’,’4’]
var obj = {‘id’:1, ‘name’:2};
delete obj.id;
delete obj[id];
console.log(obj); // {‘name’:2}
var objArray = [‘1’,’2’,’3’,’4’];
objArray.remove(‘1’);
console.log(objArray); // [‘2’,’3’,’4’]