Standard built-ins

Symbol.prototype.description

Try the free JavaScript compiler

Accessor returning the optional descriptive string of a symbol, or undefined if no description was supplied. It does not expose identity or prove registration.

Formal Syntax & Structure

javascript syntaxjavascript
sym.description

Return Value

string | undefined

Description, if supplied.

Working Example

Example Snippetjavascript
console.log(Symbol("x").description,Symbol().description);
JavaScript Reference