Although it wouldn't work if you were using objects and wanted to do a deep comparison e.g.
[...new Set([{x: 1}, {x: 1}])] [...new Set([{x: 1}, {x: 1}])]Javascript is great but sometimes I miss the predicability of the STL.