Reflect 是一個內建物件,提供了用於獲取可截取之 JavaScript 操作的方法。這些方法與 proxy handlers (en-US) 的方法相同。Reflect 不是一個函式物件,因此它是不可建構的。


Unlike most global objects, Reflect is not a constructor. You can not use it with a new operator or invoke the Reflect object as a function. All properties and methods of Reflect are static (just like the Math object).


The Reflect object provides the following static functions which have the same names as the proxy handler methods. Some of these methods are the same as corresponding methods on Object.

Reflect.apply() (en-US)
Calls a target function with arguments as specified by the args parameter. See also Function.prototype.apply().
Reflect.construct() (en-US)
 The new operator as a function. Equivalent to calling new target(...args).
Reflect.defineProperty() (en-US)
Similar to Object.defineProperty(). Returns a Boolean.
Reflect.deleteProperty() (en-US)
The delete operator as a function. Equivalent to calling delete target[name].
Reflect.get() (en-US)
A function that returns the value of properties.
Reflect.getOwnPropertyDescriptor() (en-US)
Similar to Object.getOwnPropertyDescriptor() (en-US). Returns a property descriptor of the given property if it exists on the object,  undefined otherwise.
Reflect.getPrototypeOf() (en-US)
Same as Object.getPrototypeOf().
Reflect.has() (en-US)
The in operator as function. Returns a boolean indicating whether an own or inherited property exists.
Reflect.isExtensible() (en-US)
Same as Object.isExtensible() (en-US).
Reflect.ownKeys() (en-US)
Returns an array of the target object's own (not inherited) property keys.
Reflect.preventExtensions() (en-US)
Similar to Object.preventExtensions(). Returns a Boolean.
Reflect.set() (en-US)
A function that assigns values to properties. Returns a Boolean that is true if the update was successful.
Reflect.setPrototypeOf() (en-US)
A function that sets the prototype of an object.


Specification Status Comment
ECMAScript 2015 (6th Edition, ECMA-262)
The definition of 'Reflect' in that specification.
Standard Initial definition.
ECMAScript (ECMA-262)
The definition of 'Reflect' in that specification.
Living Standard Reflect.enumerate has been removed.


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! (en-US)

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 49.0 (Yes) 42 (42) No support No support 10
Feature Android Chrome for Android Edge Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 49.0 49.0 (Yes) 42.0 (42) No support No support 10