JavaScript Reflect.get() Method

Last Updated : 16 Jun 2026

The JavaScript Reflect.get() method is used to retrieve the value of a property from an object. It works similarly to accessing a property using dot notation or bracket notation.

In this chapter, you will learn how to use the Reflect.get() method to access properties from objects and arrays.

What is JavaScript Reflect.get() Method?

The JavaScript Reflect.get() method returns the value of a specified property from an object. If the property is not found on the object, the method searches the prototype chain. If the property still cannot be found, it returns undefined.

Syntax of JavaScript Reflect.get() Method

Use the following syntax to retrieve a property value from an object:

Parameters

  • target - The target object from which the property value is retrieved.
  • propertyKey - The name of the property to retrieve.
  • receiver (optional) - The value of this provided when a getter function is encountered.

Return Type/Value

The Reflect.get() method returns the value of the specified property.

  • Returns the value associated with the specified property key.
  • Returns undefined if the property does not exist.

Exceptions

  • Throws a TypeError if the target is not an object.

Examples of JavaScript Reflect.get() Method

The following examples demonstrate how to use the Reflect.get() method.

Example 1: Retrieve Property Values from an Object

In this example, we use the Reflect.get() method to retrieve existing and non-existing properties from an object.

Output:

true

true

false

Example 2: Access a Property Through the Prototype Chain

In this example, we create an object that inherits from another object and use the Reflect.get() method to retrieve a property from its prototype.

Output:

true

Example 3: Retrieve Values from Objects and Arrays

In this example, we use the Reflect.get() method to access values from both an object and an array.

Output:

 2
 "charry"

Browser Support

BrowserVersion
Chrome49
Edge12
Firefox42
Opera36