function extend(o, n, override) {for (var p in n) {if (n.hasOwnProperty(p) && (!o.hasOwnProperty(p) || override))o[p] = n[p];} }// 默认参数 var options = {pageIndex: 1,pageTotal: 2 };// 新设置参数 var userOptions = {pageIndex: 3,pageSize: 10 }extend(options, userOptions, true);// 合并后 options = {pageIndex: 1,pageIndex: 3,pageSize: 10 }