js判断是否是数组

时间:2014-04-08 22:20:19   收藏:0   阅读:443

var arr=[];

function isArray(x){
  if(typeof(x)=="object"&&x.constructor==Array){
    return true;
  }else{
    return false;
  }
}

 

isArray(arr);//true

js判断是否是数组,布布扣,bubuko.com

原文:http://www.cnblogs.com/byit/p/3651442.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!