js数组遍历

2021-07-13 01:07

阅读:696

标签:amp   class   script   break   OLE   index   console   匿名   ...   

  /*遍历数组方法一:普通的for循环*/
    for (var i = 0; i ======================
") //数组遍历方法三:使用forEach循环 //forEach()循环是ECMAScript5.0中加入的,在低版本的IE中无法使用;forEach()中不能使用break和continue arr.forEach(function (value, index, array) {//回调函数 匿名函数 参数:索引对应的值、索引值、数组本身 if(index == arr.length - 1){ document.write( "value:" + value + "&index:" + index); }else{ document.write( "value:" + value + "&index:" + index + "==="); } });

  

js数组遍历

标签:amp   class   script   break   OLE   index   console   匿名   ...   

原文地址:https://www.cnblogs.com/menglong1214/p/9543728.html


评论


亲,登录后才可以留言!