This issue describes how to implement the sets concept exercise for the JavaScript track.
Getting started
Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:
Please also watch the following video:
Goal
This exercise aims to teach students how (and why) to use sets in JavaScript.
Learning objectives
- Know how to add and remove elements from a
Set
- Know how to check whether a value is in a
Set
- Understand how
Set checks equality
- Know how to iterate over
Set keys, values, and entries
- Know how to convert between
Set and Array
- Know how to use
Set to remove duplicate elements from an array
- Know how
WeakSet differs from Set
- Understand when
WeakSet might be preferable to Set
Out of scope
- Implementing common set operations like
union and difference
Concepts
Prerequisites
arrays
array-destructuring
equality
After
- Use cases for
WeakSet
- Lookup performance of
Set vs. Array
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.