DEV Community

Discussion on: Compare objects in JS

Collapse
 
fjones profile image
FJones • Edited

Iterating over keys has the problem that nested objects need to be considered recursively. The JSON-comparison is also fairly expensive, however.

Collapse
 
talorlanczyk profile image
TalOrlanczyk

so you can add if your or an object because check with JSON.stringify means if it's not order exactly the same it false