最近写js时碰到了当数组key不为数字时,获取数组的长度为0 的情况。1、问题场景vararr=newArray();arr['s1']=1001;console.log(arr.length);通过firebug查看:2、原因分析js Array只支持数字索引,若指定的key为非数字索引,那么l... Read More
posted @ 2014-11-01 14:36 爱生活者wmmang Views(821) Comments(0) Diggs(0) Edit