官术网_书友最值得收藏!

Removing values from lists

If you know the index of the list value that you want to remove, you can pass the index to the remove() method to create a new list without the removed value, as follows:

const myList = List.of(1, 2, 3);
const myChangedList = myList.remove(0);

console.log('myList', myList.toJS());
// -> myList [ 1, 2, 3 ]
console.log('myChangedList', myChangedList.toJS());
// -> myChangedList [ 2, 3 ]

You can see here that myChangedList results from calling remove(0). It's a new list, without the first value.

主站蜘蛛池模板: 沈丘县| 西宁市| 璧山县| 缙云县| 河源市| 红原县| 定结县| 昂仁县| 安宁市| 科尔| 玉田县| 抚松县| 扎兰屯市| 长宁区| 东山县| 蒙阴县| 连山| 永寿县| 内丘县| 奉节县| 大庆市| 酒泉市| 郓城县| 桃园县| 安乡县| 东辽县| 天柱县| 崇明县| 田林县| 三门县| 从江县| 乐业县| 滦平县| 阳东县| 盈江县| 浙江省| 佛山市| 西充县| 石楼县| 德兴市| 雷波县|