JS Built-ins
Symboldescriptionbeginner

Symbol.description β€” basic usage

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

The .description property returns the string passed when creating the symbol.

Symbol.prototype.description

The .description property returns the optional string passed when creating the symbol.

Challenge: Verify that Symbol('hello').description === 'hello'.

πŸ’‘ Hints (1)
  • β€’ Access .description directly on any symbol.