js foreach比for多出两个undefined

 

 

 

项目中发现,javascript 用foreach会比for多出两个undefined,

//会多两个undefined
 for (var i in _SysFunctions_S) {}

//正常
 $(_SysFunctions_S).each(function(index, i) {

});

 

查到一下资料

 

http://segmentfault.com/q/1010000000140735

posted on 2014-03-17 18:04  alonelonly  阅读(524)  评论(0编辑  收藏  举报

导航