JavaScript Object diff examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let obj1 = { name: "John", age: 30, city: "New York" }; | |
let obj2 = { name: "John", age: "30", city: "New York" }; | |
let obj3 = { name: "John", city: "New York", age: 30 }; | |
console.log(JSON.stringify(obj1) === JSON.stringify(obj2)); // false | |
console.log(JSON.stringify(obj1) === JSON.stringify(obj3)); // false |