JS Built-ins
SymbolkeyForbeginner

Symbol.keyFor() β€” undefined for local symbol

πŸ“– Usage Example
const local = Symbol('local')
Symbol.keyFor(local)   // β†’ undefined

Local symbols created with Symbol() are not in the registry, so keyFor returns undefined.

Symbol.keyFor with Local Symbol

A symbol created with Symbol() is not in the global registry, so Symbol.keyFor returns undefined.

Challenge: Verify the result is undefined.

πŸ’‘ Hints (1)
  • β€’ Only globally registered symbols have a key.