- 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().
推薦閱讀
- C語言程序設(shè)計(jì)(第2 版)
- C#完全自學(xué)教程
- jQuery EasyUI網(wǎng)站開發(fā)實(shí)戰(zhàn)
- Raspberry Pi for Secret Agents(Third Edition)
- JavaScript+jQuery開發(fā)實(shí)戰(zhàn)
- Flash CS6中文版應(yīng)用教程(第三版)
- Go并發(fā)編程實(shí)戰(zhàn)
- The Complete Coding Interview Guide in Java
- Visual Basic程序設(shè)計(jì)實(shí)踐教程
- Mastering Linux Security and Hardening
- Procedural Content Generation for C++ Game Development
- C專家編程
- HTML5開發(fā)精要與實(shí)例詳解
- Essential C++(中文版)
- 硬件產(chǎn)品設(shè)計(jì)與開發(fā):從原型到交付