September 2017
Intermediate to advanced
216 pages
6h 8m
English
Maps have a remove() method that works the same way as the list version. The only difference is that it takes a key as the argument instead of an index:
const myMap = Map.of( 'one', 1, 'two', 2, 'three', 3);const myChangedMap = myMap.remove('one');console.log('myMap', myMap.toJS());// -> myMap { one: 1, two: 2, three: 3 }console.log('myChangedMap', myChangedMap.toJS());// -> myChangedMap { three: 3, two: 2 }
By calling remove('one') on myMap, you get myChangedMap, a new map without the removed key.
Read now
Unlock full access