The JavaScript Set was introduced to the language in the ES2015 spec, but it has always seemed incomplete. That's about to change with the addition of functions like intersection, union and difference.
Sets are super useful for all sorts of stuff where you want the datatype to guarantee there is only one instance of a value in the collection. UI components where you are incrementally adding things to a selection is a great example.
It’s a completely standard feature in many stdlibs and has nothing to with turning JS into a database.
Sets are super useful for all sorts of stuff where you want the datatype to guarantee there is only one instance of a value in the collection. UI components where you are incrementally adding things to a selection is a great example.
It’s a completely standard feature in many stdlibs and has nothing to with turning JS into a database.