//深拷贝的实现方法,不支持函数
let arr=[0,1,2,{a:"a",b:"b",c:"c"}];
let arr2=clone(arr);
function clone(obj){
	let objType=checkType(obj);
	let temp;
	if( objType==="Array" ){
		temp=[];
	}else if( objType==="Object" ){
		temp={};
	}else{
		return obj;
	}
	for( let i in obj ){
		let tempType=checkType(obj[i]);
		if( tempType==="Array"  || tempType==="Object" ){
			temp[i]=clone(obj[i]);
		}else{
			temp[i]=obj[i];
		}
	}
	return temp;
}
function checkType(target){
	return Object.prototype.toString.call(target).slice(8,-1);
}