4 ms·
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}])]
by _ar7 9y ago
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}])]
- purple-dragon 9y ago... an important observation, for sure.
- AndrewStephens 9y agoYeah, I recently did a project in Javascript (as a longtime C++ programmer) and was bitten by this exact problem. Javascript is great but sometimes I miss the predicability of the STL.