September 2017
Intermediate to advanced
216 pages
6h 8m
English
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.
Read now
Unlock full access