`description` 是一个只读属性，它会返回 `Symbol` 对象的可选描述的字符串。

The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.

## 语法

    Symbol('myDescription').description;
    Symbol.iterator.description;
    Symbol.for('foo').description;

## 描述

`Symbol` 对象可以通过一个可选的描述创建，可用于调试，但不能用于访问 symbol 本身。`Symbol.prototype.description` 属性可以用于读取该描述。与 `Symbol.prototype.toString()` 不同的是它不会包含 "`Symbol()`" 的字符串。具体请看实例。

## 实例

    Symbol('desc').toString();   // "Symbol(desc)"
    Symbol('desc').description;  // "desc"
    Symbol('').description;      // ""
    Symbol().description;        // undefined

    // well-known symbols
    Symbol.iterator.toString();  // "Symbol(Symbol.iterator)"
    Symbol.iterator.description; // "Symbol.iterator"

    // global symbols
    Symbol.for('foo').toString();  // "Symbol(foo)"
    Symbol.for('foo').description; // "foo"

## 规范

Specification | Status
--- | ---
`get Symbol.prototype.description` proposal | Stage 3

## 浏览器兼容

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

Update compatibility data on GitHub

| Desktop | Mobile | Server
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | Safari on iOS | Samsung Internet | Node.js
`description` | Chrome Full support 70 | Edge No support No | Firefox Full support 63 | IE No support No | Opera Full support 57 | Safari No support No | WebView Android Full support 70 | Chrome Android Full support 70 | Edge Mobile No support No | Firefox Android Full support 63 | Opera Android Full support 57 | Safari iOS No support No | Samsung Internet Android No support No | nodejs No support No

### Legend

Full support
  Full support
No support
  No support

## 另请参阅

- `Symbol.prototype.toString()`
- Polyfill: https://npmjs.com/symbol.prototype.description