Reflection

Full reflection API exposing the runtime-level meta-operations on objects. This is effectively the inverse of the Proxy API, and allows making calls corresponding to the same meta-operations as the proxy traps. Especially useful for implementing proxies.

  1. var O = {a: 1};
  2. Object.defineProperty(O, 'b', {value: 2});
  3. O[Symbol('c')] = 3;
  4. Reflect.ownKeys(O); // ['a', 'b', Symbol(c)]
  5. function C(a, b){
  6. this.c = a + b;
  7. }
  8. var instance = Reflect.construct(C, [20, 22]);
  9. instance.c; // 42

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect