map.has()
indicates whether an element with a key exists
finds nothing in an empty map
finds an element by it`s key
finds undefined
as key too
does not coerce keys
after removal (using map.delete(<key>)
) it doesnt find the element anymore
adding an item (using map.set(key, value)
) later will make has()
return true
Links
A video (15min) documenting how this kata was created.
Required Knowledge
- `let` declaration (Block scope)
- basics (Map)
- `map.set()` (Map)
Related Katas
Map
- basics
map.get()
map.set()
- initialize
map.has()
Difficulty Level
BEGINNER
First Published
10 July 2015
Stats
6 tests to solve