const mySet = new Set();
// adding items
mySet.add("a new item");
// searching for a item
mySet.has("a new item");
// getting the set size
mySet.size()
// getting all items inside a set
mySet.values()
// removing item
mySet.delete("a new item");
// removing all items inside a set
mySet.clear()
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter