re: Handling Array Duplicates Can Be Tricky VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I'd just use JSON.stringify(obj) when comparing objects. Of course it all depends on the things you're trying to compare, but that is really the mo...
 

I'm no expert, but you will loose some item in your array (every non serializable like functions), it will fail on non utf8 encoded string, throws on circular reference and order will matter.

Overall, JSON is not a great way to compare complex object or array.

code of conduct - report abuse