码迷,mamicode.com
首页 > 编程语言 > 详细

数组的遍历

时间:2019-01-08 14:58:09      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:style   console   oct   获取   ons   一个   head   code   i++   

 1 <!DOCTYPE html>
 2 <html>
 3 <head lang="en">
 4     <meta charset="UTF-8">
 5     <title></title>
 6 </head>
 7 <body>
 8 <script>
 9 
10     var arr = ["关羽","张飞","赵云","马超","黄忠"];
11 
12     //遍历数组就是循环(获取)数组中的每一项
13     for(var i=0;i<arr.length;i++){
14         //代表的是数组中的每一个元素;
15 //        arr[i]
16         console.log(arr[i]);
17     }
18 
19 
20 </script>
21 </body>
22 </html>

 

数组的遍历

标签:style   console   oct   获取   ons   一个   head   code   i++   

原文地址:https://www.cnblogs.com/BingBing-Deng/p/10238323.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!