标签:call type == var string 判断 array prot ring
var arr=[];
var obj={};
console.log(Object.prototype.toString.call(arr) === ‘[object Array]‘);//true
console.log(Object.prototype.toString.call(obj) === ‘[object Array]‘);//false
console.log(arr instanceof Array);//true
console.log(obj instanceof Array);//false
console.log(Array.isArray(arr));//true
console.log(Array.isArray(obj));//false
标签:call type == var string 判断 array prot ring
原文地址:http://www.cnblogs.com/week-1/p/6555324.html