September 2017
Intermediate to advanced
216 pages
6h 8m
English
If you have more than one value to remove from a collection, you can chain together removal method calls, as follows:
const myList = List.of(1, 2, 3, 4);const myMap = Map.of( 'one', 1, 'two', 2, 'three', 3, 'four', 4, 'five', 5, 'six', 6);const myChangedList = myList .remove(1) .remove(1);const myChangedMap = myMap .remove('six') .removeAll(['five', 'four', 'three']);console.log('myList', myList.toJS());// -> myList [ 1, 2, 3, 4 ]console.log('myMap', myMap.toJS());// -> myMap { one: 1, two: 2, three: 3, four: 4, five: 5, six: 6 }console.log('myChangedList', myChangedList.toJS());// -> myChangedList [ 1, 4 ]console.log('myChangedMap', myChangedMap.toJS());// -> myChangedMap { one: 1, two: 2 }
There are two ...
Read now
Unlock full access