September 2017
Intermediate to advanced
216 pages
6h 8m
English
Let's revisit the earlier example where we called update() on a list. Inside of the update function, increment(), we used set() to change the value of map. Map was the list value that we were updating. Let's make map use the update() method as well:
const increment = map => map.update( 'total', t => t + map.get('step'));
Instead of having to call map.get('total'), total is passed in as the function argument.
Read now
Unlock full access