摘要:
1.问题描述 for in循环的index值与某值求余数,一直不等于0,代码如需: for (const index in slicedArr) { comm.log('(index+1)%5=='+(index+1)%5) if((index+1)%5 != 0){ continue } ... 阅读全文
摘要:
转载自:https://segmentfault.com/q/1010000006658882 简单说,for in是遍历键名,for of是遍历键值。例如: let arr = ["a","b"]; for (a in arr) { console.log(a);//1,2 } for (a of 阅读全文