`Reflect``.get()` 方法的工作方式，就像从 object (`target[propertyKey]`) 中获取属性，但它是作为一个函数执行的。

## 语法

    Reflect.get(target, propertyKey[, receiver])

### 参数

`target`
  需要取值的目标对象
`propertyKey`
  需要获取的值的键值
receiver
  如果遇到 getter，此值将提供给目标调用。

### 返回值

属性值。

### 异常

如果目标值类型不是 `Object`，则抛出一个 `TypeError`。

## 描述

`Reflect.get 方法允许你从一个对象中取值`。就如同函数（function）里的 属性访问器 语法。

## 实例

### `使用 Reflect.get()`

    // Object
    var obj = { x: 1, y: 2 };
    Reflect.get(obj, "x"); // 1

    // Array
    Reflect.get(["zero", "one"], 1); // "one"

    // Proxy with a get handler
    var x = {p: 1};
    var obj = new Proxy(x, {
      get(t, k, r) { return k + "bar"; }
    });
    Reflect.get(obj, "foo"); // "foobar"

## 规范

Specification | Status | Comment
--- | --- | ---
ECMAScript 2015 (6th Edition, ECMA-262) Reflect.get | Standard | Initial definition.
ECMAScript Latest Draft (ECMA-262) Reflect.get | Draft |

## 浏览器兼容性

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
`get` | Chrome Full support 49 | Edge Full support 12 | Firefox Full support 42 | IE No support No | Opera Full support 36 | Safari Full support 10 | WebView Android Full support 49 | Chrome Android Full support 49 | Edge Mobile Full support Yes | Firefox Android Full support 42 | Opera Android Full support 36 | Safari iOS Full support 10 | Samsung Internet Android Full support 5.0 | nodejs Full support 6.0.0

### Legend

Full support
  Full support
No support
  No support

## 相关链接

- `Reflect`
- Property accessors