Array.isArray()

1 var isArray = function(arr){
2         return typeof Array.isArray === "function" ? Array.isArray(arr) : Object.prototype.toString.call(arr) === "[object Array]";
3     };
4     var arr = [1, 2, 3, 4];
5     console.log(isArray(arr));
疯癫不成狂,有酒勿可尝;世间良辰美,终成水墨白。
原文地址:https://www.cnblogs.com/chuyu/p/3359125.html