数组检测方法

var isArray = Array.isArray || function(o) {
    return typeof o === "object" &&
    Object.prototype.toString.call(o) === "[object Array]";
};

isArray([]);//true
posted @ 2016-08-23 19:47  jiapeng  阅读(156)  评论(0编辑  收藏  举报