var json = {
pageNum : pageNum,
pageSize : 3
};
添加单个数据:
json.age= 18;
结果:
var json = {
pageNum : pageNum,
pageSize : 3,
age:18
};
循环添加数组:
$.each(集合名,function(i,e){
json[' 数组名['+i+'] '] = 值;
});
创建空对象
var emptyObj1 = {}; var emptyObj2 = new Object();
创建空数组
var emptyArr1 = []; var emptyArr2 = new Array();
参考:https://www.cnblogs.com/liangzi4000/p/5979102.html