var list = []; var param = {}; ....... var hasProp = false; for (var prop in param){ hasProp = true; break; } if(hasProp) { list.push(param); }
判断对象param是否为空的代码
var list = []; var param = {}; ....... var hasProp = false; for (var prop in param){ hasProp = true; break; } if(hasProp) { list.push(param); }
判断对象param是否为空的代码