摘要: 直接上结论: 遍历修改数组时,如果数组的项是字符串,如果要修改数组的项,不能采用item的方式直接修改,应该采取下标的方式修改数组的项. 例如: var arr=["one", "two", "three"]; arr.forEach((item,index)=>{ item="four"; }) 阅读全文
posted @ 2020-12-16 19:38 你真有趣 阅读(606) 评论(0) 推荐(1)