JS Built-ins
SymboltoStringbeginner

Symbol.toString() β€” 'Symbol(x)'

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

Symbol.prototype.toString() returns a string in the format 'Symbol(description)'.

Symbol.prototype.toString()

sym.toString() returns the string representation "Symbol(description)".

Challenge: Verify the output for Symbol('x').

πŸ’‘ Hints (1)
  • β€’ The result is always "Symbol(" + description + ")".