fn()
{
var
arr
=
array.prototype.slice.call(arguments,0)
alert(arr.length)}
function combineConfig(config)
{
let defconfig = {
name : "我是默认name",
age : "我是默认age:12",
}
defconfig = {...defconfig,...config}
return defconfig
}
function combineConfig_Object(config)
{
let defconfig = {
name : "我是默认name Object",
age : "我是默认age:12 Object",
}
Object.assign(defconfig, config)
return defconfig
}
function combineConfig_jquery(config)
{
let defconfig = {
name : "我是默认name jquery",
age : "我是默认age:12 jquery",
}
$.extend(defconfig, config)
return defconfig
}
function combineConfig_for(config)
{
let defconfig = {
name : "我是默认name jquery",
age : "我是默认age:12 jquery",
}
for (let k in config)
{
defconfig[k] = config[k]
}
return defconfig
}