JS Built-ins
SymboltoStringbeginner

Symbol.toString() β€” includes description

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

The description text is always embedded inside the parentheses in the toString output.

Symbol toString Contains Description

The string representation always includes the description text.

Challenge: Check that Symbol('hello').toString() includes 'hello'.

πŸ’‘ Hints (1)
  • β€’ The description appears inside the parentheses.