Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScriptSymbol registrySingle-choice MCQ

A symbol created with Symbol('x') and one created with Symbol.for('x') both have description 'x'. Internally, what distinguishes them and how does Symbol.keyFor expose that difference?

const a = Symbol('x'); const b = Symbol.for('x'); console.log(Symbol.keyFor(a), Symbol.keyFor(b));