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

For a symbol obtained via Symbol.for, what does Symbol.keyFor return, and how does that differ for a symbol made with the Symbol() constructor?

const s1 = Symbol.for('token'); const s2 = Symbol('token'); const k1 = Symbol.keyFor(s1); const k2 = Symbol.keyFor(s2);