## 概述

`Symbol.keyFor(sym)` 方法用来获取 symbol 注册表中与某个 symbol 关联的键。

## 语法

    Symbol.keyFor(sym);

### 参数

sym
  存储在 symbol 注册表中的某个 symbol

## 示例

    // 创建一个 symbol 并放入 Symbol 注册表，key 为 "foo"
    var globalSym = Symbol.for("foo");
    Symbol.keyFor(globalSym); // "foo"

    // 创建一个 symbol，但不放入 symbol 注册表中
    var localSym = Symbol();
    Symbol.keyFor(localSym); // undefined，所以是找不到 key 的

    // well-known symbol 们并不在 symbol 注册表中
    Symbol.keyFor(Symbol.iterator) // undefined

## 规范

Specification | Status | Comment
--- | --- | ---
ECMAScript 2015 (6th Edition, ECMA-262) Symbol.keyFor | Standard | Initial definition.

## 浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

- Desktop
- Mobile

Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari
--- | --- | --- | --- | --- | ---
Basic support | 未实现 | 33.0 (33.0) | 未实现 | 未实现 | 未实现

Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile
--- | --- | --- | --- | --- | --- | ---
Basic support | 未实现 | 未实现 | 33.0 (33.0) | 未实现 | 未实现 | 未实现

## 相关链接

- `Symbol.prototype.for()`