JS Built-ins
Symbolforbeginner

Symbol.for() β€” description matches key

πŸ“– Usage Example
const s = Symbol.for('id')
s.description   // β†’ 'id'

For global symbols, .description is always equal to the registration key.

Symbol.for Description

For a symbol created with Symbol.for('x'), the .description is 'x'.

Challenge: Verify the description of a global symbol.

πŸ’‘ Hints (1)
  • β€’ The description of Symbol.for(key) equals the key.