- Mastering Immutable.js
- Adam Boduch
- 75字
- 2021-07-08 10:30:11
Updating map values
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.
推薦閱讀
- DevOps:軟件架構師行動指南
- Java多線程編程實戰指南:設計模式篇(第2版)
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- Game Programming Using Qt Beginner's Guide
- Web全棧工程師的自我修養
- 單片機C語言程序設計實訓100例
- JavaCAPS基礎、應用與案例
- 好好學Java:從零基礎到項目實戰
- 智能搜索和推薦系統:原理、算法與應用
- Oracle數據庫編程經典300例
- Nagios Core Administration Cookbook(Second Edition)
- JSP程序設計與案例實戰(慕課版)
- Building Slack Bots
- Laravel Design Patterns and Best Practices
- Web前端測試與集成:Jasmine/Selenium/Protractor/Jenkins的最佳實踐