initialize a Map
a new Map()
is empty, has size=0
init Map with [[]]
has a size=1
init a Map with [[1]]
is the same as map.set(1, void 0)
init Map with multiple key+value pairs
keys are unique, the last one is used
init Map from an Object, is a bit of work
Required Knowledge
- `let` declaration (Block scope)
- `const` declaration (Block scope)
- `Array.from()` (Array API)
- basics (Map)
- `map.set()` (Map)
Related Katas
Map
Difficulty Level
ADVANCED
First Published
22 June 2015
Stats
6 tests to solve