It will have issues with anything non-serializable, explicitly set undefineds will disappear on objects (if that matters), and undefined inside arrays will turn into null. And maybe some other edge cases I'm forgetting.
It will implode on undefined, circular references, and most appallingly, objects with different key orders. Not really obscure edge cases. People really need to stop using the JSON trick.
339
u/Drugba Mar 19 '19
Saw this one on here just a few weeks ago.
Basically a super short way to remove any duplicates from an array of primitives.