An Introduction to Sets in JavaScript

Using sets to deal with unique elements in a dataset

Ashutosh K Singh
Better Programming
Published in
2 min readAug 14, 2019

--

Photo by JOSHUA COLEMAN on Unsplash

Sets are a new object type included in ES6 that allow the creation of collections of unique values. The values in a set can be either simple primitives like strings and integers or more complex object types like object literals or arrays. Think of sets as an array with no repeated elements.

--

--