function fn(type){
let str=Object.prototype.toString.call(type);
return str.substring(str.indexOf(' ')+1,str.length-1)
}
console.log(fn([]));
是Object下的方法,并用call改变指向
function fn(type){
let str=Object.prototype.toString.call(type);
return str.substring(str.indexOf(' ')+1,str.length-1)
}
console.log(fn([]));
是Object下的方法,并用call改变指向