码迷,mamicode.com
首页 > Web开发 > 详细

js用for...in 这种遍历的方式

时间:2018-03-18 17:16:34      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:code   second   class   line   index   plain   item   array   key   

var arr = new Array("first", "second", "third")
for(var item in arr) {
document.write(arr[item]+",");
}

js用for...in 这种遍历的方式

标签:code   second   class   line   index   plain   item   array   key   

原文地址:https://www.cnblogs.com/feifeicui/p/8595917.html

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