摘要: 第一次forEach循环,index是0,item是1 ,arr是[1,1,2], if条件成立,使用splice最终的arr是【1,2】 第二次循环,index是1,item是2,arr是[1,2], if条件不成立,使用splice无法删除了第二个重复的1; 原因是使用splice容易使数组的i 阅读全文
posted @ 2018-08-16 17:11 我就是那个王小明 阅读(3314) 评论(0) 推荐(0) 编辑