Unordered JSON compare for differences using javascript
Sometimes we need to programmatically compare JSON from two or more sources and determine what's the difference between them. The program below can do deep compare JSON even if they are not in the same order or conatins substructures and arrays. It provides the detailed list of mismatches and misses in both JSON's by calling out attributes with the same keys and different values or missing keys. const obj1={ "k1":"aq", "k2":"b", "k3":"c", "k4":{ "kk1":"aq", "kk2":"b", "kk3":"c", "kk4":{ "kkk1":"" }, "kk5":"abc" }, "k5":[{"kk5":"abc","kk6":"53"},{"kk5":"abc","kk6":"54"}] } const obj2={ "k1":"a", "k2