let arr= Frame_Shit_delMessense_MutationIn_Frame_DelSplite_SiteNonsense_MutationMulti_Hit获取arr索引
可以使用for循环来获取arr数组的索引,也可以使用forEach方法来获取:
- 使用for循环获取索引:
for(let i=0; i<arr.length; i++) {
console.log(i); // 输出0, 1, 2, 3, 4, 5
}
- 使用forEach方法获取索引:
arr.forEach(function(item, index) {
console.log(index); // 输出0, 1, 2, 3, 4, 5
});
原文地址: http://www.cveoy.top/t/topic/MHz 著作权归作者所有。请勿转载和采集!