- 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().
推薦閱讀
- Learning Neo4j
- Mobile Application Development:JavaScript Frameworks
- Cocos2d-x游戲開發:手把手教你Lua語言的編程方法
- 我的第一本算法書
- The React Workshop
- Visual Basic程序設計習題解答與上機指導
- Learning YARN
- 深度學習入門:基于Python的理論與實現
- 從零開始學UI:概念解析、實戰提高、突破規則
- Android高級開發實戰:UI、NDK與安全
- 大話代碼架構:項目實戰版
- Isomorphic Go
- SOA Patterns with BizTalk Server 2013 and Microsoft Azure(Second Edition)
- C++ Data Structures and Algorithm Design Principles
- jQuery權威指南