
显示上图中使用了两种方式,
左边的是filter将不等于userCode的元素筛选出来组成一个新的list,
userCodeList.filter(item==> item!=userCode);
但是上面这个方法在IE浏览器中不支持,
所以改成了右边的方法,使用splice:
userCodeList.splice(userCodeList.indexof(userCode),1);
splice传入两个参数,第一个参数是要删除的元素的索引位置,第二个是从这个索引往后删除几个;






![[C++开发 02_1/5_ 程序的内存模型(84)]](https://img-blog.csdnimg.cn/direct/3d6e9d23443f493b940cf08582f4d081.png)












