- Mastering Immutable.js
- Adam Boduch
- 54字
- 2021-07-08 10:30:08
Maps of values
You can use the of() method to create key-value maps:
const myMap = Map.of(
'a', 1,
'b', 2,
'c', 3
);
console.log('myMap', myMap.toJS());
// -> myMap { a: 1, b: 2, c: 3 }
The trick here is to alternate between the key and value arguments that are passed to of().
推薦閱讀
- Java面向對象思想與程序設計
- 單片機C語言程序設計實訓100例:基于STC8051+Proteus仿真與實戰
- 編寫高質量代碼:改善Python程序的91個建議
- Groovy for Domain:specific Languages(Second Edition)
- Apache Mesos Essentials
- 編寫高質量代碼:改善Objective-C程序的61個建議
- Beginning C++ Game Programming
- Troubleshooting Citrix XenApp?
- Laravel Design Patterns and Best Practices
- Developing Java Applications with Spring and Spring Boot
- Software Architecture with Python
- VB語言程序設計教程(第2版)
- 活文檔:與代碼共同演進
- AngularJS Deployment Essentials
- Mastering Predictive Analytics with R(Second Edition)