MediumType Coercion💻 Output Question

Object equality is reference-based

💡

Hint

Object equality compares references, not content. Two objects with identical properties are NOT equal unless same reference.

What does this output?

const a = { x: 1 };
const b = { x: 1 };
const c = a;
console.log(a == b);
console.log(a === b);
console.log(a === c);
console.log(a.x === c.x);

Correct Output

false
false
true
true

Why this output?

Explanation: a and b are different objects — same content but different references. c = a copies the reference, so a===c is true.

Key Insight: Object equality compares references, not content. Two objects with identical properties are NOT equal unless same reference.

More Type Coercion Output Questions

EasyPlus operator: string concat vs numeric addMediumLoose equality edge cases with nullEasytypeof for common valuesMediumTruthy and falsy — empty array and object are truthy

Practice predicting output live →

66 output questions with instant feedback

💻 Try Output Quiz