首页 > 编程语言 > 详细

javascript中的for……in循环

时间:2014-09-12 14:58:53      阅读:293      评论:0      收藏:0      [点我收藏+]

  <script type="text/javascript">
   var theBeatles=new Array("John","Paul","Gearge","Ringo");
   for(var loopCounter=0;loopCounter<theBeatles.length;loopCounter++){
       document.write(theBeatles[loopCounter]+"<br>");
   }
   var indexKey;
   for(indexKey in theBeatles){
       document.write("indexKey is "+indexKey+"<br>");
       document.write("item value is "+theBeatles[indexKey]+"<br><br>");
   }
   </script>

javascript中的for……in循环

原文:http://www.cnblogs.com/vonk/p/3968328.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!