JS Built-ins
SymbolkeyForintermediate

Symbol.keyFor() β€” well-known symbols return undefined

πŸ“– Usage Example
Symbol.keyFor(Symbol.iterator)    // β†’ undefined
Symbol.keyFor(Symbol.for('x'))     // β†’ 'x'

Well-known symbols are not in the global registry, so Symbol.keyFor returns undefined for them.

Well-Known Symbols and keyFor

Well-known symbols like Symbol.iterator are NOT in the global string-keyed registry, so Symbol.keyFor returns undefined for them.

Challenge: Verify this behaviour.

πŸ’‘ Hints (1)
  • β€’ Well-known symbols live outside the global string registry.