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

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.

主站蜘蛛池模板: 西乌珠穆沁旗| 浮梁县| 灌阳县| 泰顺县| 鸡泽县| 炎陵县| 延安市| 微山县| 百色市| 炉霍县| 深水埗区| 锡林浩特市| 舒城县| 伊春市| 海淀区| 保山市| 永修县| 孟连| 桂林市| 大足县| 库尔勒市| 三江| 福建省| 全南县| 卢氏县| 贵南县| 两当县| 保康县| 遵义市| 阿克苏市| 通许县| 肇东市| 安庆市| 罗田县| 大连市| 灵石县| 柞水县| 武宁县| 岚皋县| 宁津县| 宕昌县|