clear()
removes all elements from a Set object.
set.size
becomes 0
the iterator set.entries()
will not contain any items
any call to set.has()
returns false
returns undefined
Links
How the implementation is specified.
The MDN docs.
Announcement of this kata on twitter.
Required Knowledge
- `let` declaration (Block scope)
- `const` declaration (Block scope)
- object (Destructuring)
- basics (Set)
- `set.add()` (Set)
Related Katas
Set
- basics
set.add()
set.delete()
- the API
set.clear()
Difficulty Level
BEGINNER
First Published
3 August 2015
Stats
4 tests to solve