`

JS中数组遍历切忌 for in

阅读更多
Array.prototype.test = 'test_prototype';

var arr = [1,2,3,4,5,6];

for (var i in arr){
    console.log(i);
}

>>0
>>1
>>2
>>3
>>4
>>5
>>test

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics