console.log(Array.isArray([]));//true console.log(Array.isArray({}));//false //模拟上边的 var isArray1 = Function.isArray||function(o){ return typeof o === "object" && Object.prototype.toString.call(o) === "[object Array]"; }; console.log(isArray1([]));//true console.log(isArray1({}));//false
您可能感兴趣的文章: