MSDN references JavaScript\'s Set collection abstraction. I\'ve got an array of objects that I\'d like to convert to a set so that I am able to remove (.delete()
.delete()
If you start out with:
let array = [ {name: "malcom", dogType: "four-legged"}, {name: "peabody", dogType: "three-legged"}, {name: "pablo", dogType: "two-legged"} ];
And you want a set of, say, names, you would do:
let namesSet = new Set(array.map(item => item.name));