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

Regarding the global Symbol registry used by Symbol.for and Symbol.keyFor, what is the precise behavior across the registry and how does it differ from Symbol() with the same description?

const s1 = Symbol.for('k'); const s2 = Symbol.for('k'); const s3 = Symbol('k'); const a = s1 === s2; const b = Symbol.keyFor(s1); const c = Symbol.keyFor(s3);