var s={};/原始对象
//为原对象扩展一个extend方法
s.extend=function({
var target=arguments[0]||{},//目标对象
e=false,//是否进行深拷贝
h=1,//参数个数
n= arguments.length,//实际传入的参数个数
temp;// 临时保存源参数
if(typeof a =='boolean'){
e=arguments[0];
target=arguments[1]||{};
//skip the boolean and target
h=2;
}
// Handle case when target is a string or something (possible in deep copy)
if (typeof target !== "object" && typeof target!== "function")
target = {};
// extend object itself if only one argument is passed
if (n == h) {
target = this;
--h;