Is there any way to create Set data structure(Unique Collections) like java in javascript?
In modern browsers, I would use a Map using only the keys' methods. For example:
let mySet = new Map();
mySet.set(element, 1)
mySet.delete(element)
mySet.has(element)
You can make your own wrapper if you don't want to see the Map implementation. This approach is how Java HashSet is implemented, it uses a HashMap and only uses the key methods.