- Mastering Immutable.js
- Adam Boduch
- 45字
- 2021-07-08 10:30:09
Parsing JavaScript objects
You can parse a regular JavaScript object, resulting in a map:
const myMap = fromJS({
one: 1,
two: 2,
three: 3
});
console.log('myMap', myMap.get('one'));
// -> myMap 1
Once again, this is just like passing the object literal to the Map constructor.