JS Built-ins
Symbolforbeginner

Symbol.for() β€” typeof result

πŸ“– Usage Example
typeof Symbol.for('x')   // β†’ 'symbol'

Symbol.for() returns a symbol primitive β€” typeof is always 'symbol'.

Symbol.for() Returns a Symbol

The return type of Symbol.for() is still 'symbol'.

Challenge: Verify the type.

πŸ’‘ Hints (1)
  • β€’ Even global symbols have type "symbol".