const a = { x: 1 }; const b = { x: 1 }; // === is false: different objects console.log(a === b); // compare contents by serializing (order matters) console.log(JSON.stringify(a) === JSON.stringify(b));
=== is identity; compare fields yourself