javascript数组之循环
第一种遍历数组的循环,使用for循环
for(let i=0;i<arrary.length;i++) { console.log(arrary[i]) }第二种遍历数组的循环,使用for-in,这里遍历的是数组下标
for(let index in arrary) { console.log(arrary[index]) }第三种遍历方式是for-of
for(let j of arrary) { console.log(j) }第一种遍历数组的循环,使用for循环
for(let i=0;i<arrary.length;i++) { console.log(arrary[i]) }第二种遍历数组的循环,使用for-in,这里遍历的是数组下标
for(let index in arrary) { console.log(arrary[index]) }第三种遍历方式是for-of
for(let j of arrary) { console.log(j) }