标签:ons span let pre nbsp key rip 用法 trie
1 let arr=["A","B","C","D","E","F"]; 2 for(let i=0;i<arr.length;i++){ 3 console.log(arr[i]); 4 }
遍历出数组中的每个值
1 let arr=["A","B","C","D","E","F"]; 2 for(let item of arr){ 3 console.log(item); 4 }
//A B C D E F
遍历出数组中每个值的下标
1 let arr=["A","B","D","E","F"]; 2 for(let item in arr){ 3 console.log(item); 4 } //0 1 2 3 4 5
1 let arr=["A","B","C","D","E","F"]; 2 for(let item of arr.keys()){ 3 console.log(item); 4 } 5 //0 1 2 3 4 5
1 let arr=["A","B","C","D","E","F"]; 2 for(let item of arr.values()){ 3 console.log(item); 4 } 5 //A B C D E F
1 let arr=["A","B","C","D","E","F"]; 2 for(let item of arr.entries()){ 3 console.log(item); 4 } 5 /** 6 [ 0, ‘A‘ ] 7 [ 1, ‘B‘ ] 8 [ 2, ‘C‘ ] 9 [ 3, ‘D‘ ] 10 [ 4, ‘E‘ ] 11 [ 5, ‘F‘ ] 12 **/
标签:ons span let pre nbsp key rip 用法 trie
原文地址:https://www.cnblogs.com/Lotus3904/p/12182023.html