摘要:
let extend = function(obj: object,objs: object,deep: boolean) { deep = deep || false; // tue深copy false 浅copy for(let pro in objs) { if(!deep) { obj[p 阅读全文
摘要:
因为无论是数组还是对象,对于typeof的操作返回值都为object,所以就有了区分数组类型和对象类型的需要: 方一:通过length属性:一般情况下对象没有length属性值,其值为undefiend,而数组的length值为number类型 缺点:非常不实用,当对象的属性存在length,且其值 阅读全文