Values & References9 / 18
Up next

Compare by contents

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));
What you're solving

=== is identity; compare fields yourself