JS: Reflect

By Xah Lee. Date: . Last updated: .

New in ES2015.

Reflect is the value of the property key "Reflect" of the global object. [JS: the Global Object]

console.log ( window.Reflect === Reflect ); // true


Type of Reflect is object.

[see JS: Value Types]

// type of Reflect
console.log ( typeof Reflect === "object" ); // true
console.log ( Object.prototype.toString.call(Reflect) === "[object Object]" ) // true


Parent of Reflect is Object.prototype. [see JS: Prototype and Inheritance] [see JS: Object.prototype]

console.log ( Reflect.getPrototypeOf ( Reflect ) === Object.prototype); // true


The Reflect object is used as namespace to host a group of static functions. (like the Math object. [see JS: Math] )

Reflect's methods typically:

[see JS: Object Object]

[see JS: Function Object]



ECMAScript 2015 §Reflection#sec-reflect-object

Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS in Depth
  4. JS Reference
  5. DOM
  6. SVG
  7. Web Dev Blog