--- title: Reflect slug: Web/JavaScript/Reference/Global_Objects/Reflect translation_of: Web/JavaScript/Reference/Global_Objects/Reflect ---
Reflect 是一個內建物件,提供了用於獲取可截取之 JavaScript 操作的方法。這些方法與 proxy handlers 的方法相同。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 {{jsxref("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 {{jsxref("Object")}}.
args
parameter. See also {{jsxref("Function.prototype.apply()")}}.new
operator as a function. Equivalent to calling new target(...args)
.delete
operator as a function. Equivalent to calling delete target[name]
.in
operator as function. Returns a boolean indicating whether an own or inherited property exists.true
if the update was successful.Specification | Status | Comment |
---|---|---|
{{SpecName('ES2015', '#sec-reflect-object', 'Reflect')}} | {{Spec2('ES2015')}} | Initial definition. |
{{SpecName('ESDraft', '#sec-reflect-object', 'Reflect')}} | {{Spec2('ESDraft')}} | Reflect.enumerate has been removed. |
{{CompatibilityTable}}
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | {{CompatChrome(49.0)}} | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("42")}} | {{CompatNo}} | {{CompatNo}} | {{CompatSafari(10)}} |
Feature | Android | Chrome for Android | Edge | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support | {{CompatChrome(49.0)}} | {{CompatChrome(49.0)}} | {{CompatVersionUnknown}} | {{CompatGeckoMobile("42")}} | {{CompatNo}} | {{CompatNo}} | {{CompatSafari(10)}} |