--- title: Reflect slug: Web/JavaScript/Reference/Global_Objects/Reflect tags: - ECMAScript 2015 - JavaScript - NeedsTranslation - Overview - Reflect - TopicStub translation_of: Web/JavaScript/Reference/Global_Objects/Reflect --- <div>{{JSRef}}</div> <p><strong>Reflect </strong> es un objecto incorporado que proporciona metodos para interceptar operaciones de javascript. Los métodos son los mismos que los de <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler">proxy handlers</a>. <code>Reflect</code> no es un objeto de funciones y por lo tanto no puede ser construido.</p> <h2 id="Descripción">Descripción</h2> <p>A diferencia de la mayoria de los objetos globales, <code>Reflect</code> no es un constructor. No puede ser instanciado con un <a href="/en-US/docs/Web/JavaScript/Reference/Operators/new">operador</a> <a href="/en-US/docs/Web/JavaScript/Reference/Operators/new"><code>new</code> </a>o invocando el objecto <code>Reflect</code> como una función. Todas las propiedades y métodos de <code>Reflect</code> son estáticos (igual que los del objeto {{jsxref("Math")}}).</p> <h2 id="Métodos">Métodos</h2> <p>El objeto <code>Reflect</code> proporciona las siguientes funciones estáticas con los mismos nombres de los métodos de <a href="/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler">proxy handler</a>. Algunos de estos métodos son correspondientes a los métodos de {{jsxref("Object")}}.</p> <dl> <dt>{{jsxref("Reflect.apply()")}}</dt> <dd>Calls a target function with arguments as specified by the <code>args</code> parameter. See also {{jsxref("Function.prototype.apply()")}}.</dd> <dt>{{jsxref("Reflect.construct()")}}</dt> <dd> The <a href="/en-US/docs/Web/JavaScript/Reference/Operators/new"><code>new</code> operator</a> as a function. Equivalent to calling <code>new target(...args)</code>.</dd> <dt>{{jsxref("Reflect.defineProperty()")}}</dt> <dd>Similar to {{jsxref("Object.defineProperty()")}}. Returns a {{jsxref("Boolean")}}.</dd> <dt>{{jsxref("Reflect.deleteProperty()")}}</dt> <dd>The <a href="/en-US/docs/Web/JavaScript/Reference/Operators/delete"><code>delete</code> operator</a> as a function. Equivalent to calling <code>delete target[name]</code>.</dd> <dt>{{jsxref("Reflect.get()")}}</dt> <dd>A function that returns the value of properties.</dd> <dt>{{jsxref("Reflect.getOwnPropertyDescriptor()")}}</dt> <dd>Similar to {{jsxref("Object.getOwnPropertyDescriptor()")}}. Returns a property descriptor of the given property if it exists on the object, {{jsxref("undefined")}} otherwise.</dd> <dt>{{jsxref("Reflect.getPrototypeOf()")}}</dt> <dd>Same as {{jsxref("Object.getPrototypeOf()")}}.</dd> <dt>{{jsxref("Reflect.has()")}}</dt> <dd>The <a href="/en-US/docs/Web/JavaScript/Reference/Operators/in"><code>in</code> operator</a> as function. Returns a boolean indicating whether an own or inherited property exists.</dd> <dt>{{jsxref("Reflect.isExtensible()")}}</dt> <dd>Same as {{jsxref("Object.isExtensible()")}}.</dd> <dt>{{jsxref("Reflect.ownKeys()")}}</dt> <dd>Returns an array of the target object's own (not inherited) property keys.</dd> <dt>{{jsxref("Reflect.preventExtensions()")}}</dt> <dd>Similar to {{jsxref("Object.preventExtensions()")}}. Returns a {{jsxref("Boolean")}}.</dd> <dt>{{jsxref("Reflect.set()")}}</dt> <dd>A function that assigns values to properties. Returns a {{jsxref("Boolean")}} that is <code>true</code> if the update was successful.</dd> <dt>{{jsxref("Reflect.setPrototypeOf()")}}</dt> <dd>A function that sets the prototype of an object.</dd> </dl> <h2 id="Especificaciones">Especificaciones</h2> <table class="standard-table"> <tbody> <tr> <th scope="col">Specification</th> <th scope="col">Status</th> <th scope="col">Comment</th> </tr> <tr> <td>{{SpecName('ES2015', '#sec-reflect-object', 'Reflect')}}</td> <td>{{Spec2('ES2015')}}</td> <td>Initial definition.</td> </tr> <tr> <td>{{SpecName('ESDraft', '#sec-reflect-object', 'Reflect')}}</td> <td>{{Spec2('ESDraft')}}</td> <td>Reflect.enumerate has been removed.</td> </tr> </tbody> </table> <h2 id="Compatibilidad_en_Navegadores">Compatibilidad en Navegadores</h2> <p>{{CompatibilityTable}}</p> <div id="compat-desktop"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Edge</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>{{CompatChrome(49.0)}}</td> <td>{{CompatVersionUnknown}}</td> <td>{{CompatGeckoDesktop("42")}}</td> <td>{{CompatNo}}</td> <td>{{CompatNo}}</td> <td>{{CompatSafari(10)}}</td> </tr> </tbody> </table> </div> <div id="compat-mobile"> <table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Chrome for Android</th> <th>Edge</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{CompatChrome(49.0)}}</td> <td>{{CompatChrome(49.0)}}</td> <td>{{CompatVersionUnknown}}</td> <td>{{CompatGeckoMobile("42")}}</td> <td>{{CompatNo}}</td> <td>{{CompatNo}}</td> <td>{{CompatSafari(10)}}</td> </tr> </tbody> </table> </div> <h2 id="También_ver">También ver</h2> <ul> <li>The {{jsxref("Proxy")}} global object.</li> <li>The {{jsxref("Proxy.handler", "handler")}} object.</li> </ul>