JS Built-ins
Symbolbeginner

Symbol() β€” typeof is symbol

πŸ“– Usage Example
const sym = Symbol('id')
typeof sym   // β†’ 'symbol'

Symbol() creates a primitive whose typeof is always 'symbol'.

Symbol Constructor

Symbol(description?) creates a new unique symbol primitive.

Challenge: Verify that typeof Symbol('x') is 'symbol'.

πŸ’‘ Hints (1)
  • β€’ Use the typeof operator to check the type of a Symbol.