JavaScript Reflect.get() Method

Beginner
6 min read
Updated: Nov 2026
3 examples
Static method

Definition

Reflect.get(target, propertyKey) reads a property from an object and returns its value. It does the same as target[propertyKey], but as a function call.

An optional third argument, receiver, is the value that this will have if the property is a getter. This is very useful inside a Proxy, where it keeps getters working correctly.

Remember
Reflect.get(target, key, receiver)

target    → the object to read from
key       → property name (string or symbol)
receiver  → optional: this for a getter

missing property → undefined
target must be an object, or TypeError

Syntax

Pass an object and the name of the property to read.

JavaScript
const user = { name: "Ann", age: 30 };

console.log(Reflect.get(user, "name"));      // Ann
console.log(Reflect.get(user, "city"));      // undefined
console.log(Reflect.get([10, 20, 30], 1));   // 20
CallWhat it does
Reflect.get(obj, "name")Read obj.name.
Reflect.get(arr, 0)Read an array item. A number key works like a string key.
Reflect.get(obj, "fullName", other)Read a getter, with other as its this.
obj.nameThe usual syntax. Use it when you do not need a function or a receiver.

A standard JavaScript static method (ES2015) of the Reflect object: call it as Reflect.get(). No import required. Siblings: Reflect.apply(), Reflect.construct(), Reflect.defineProperty(), Reflect.deleteProperty(), Reflect.getOwnPropertyDescriptor(), Reflect.getPrototypeOf(), Reflect.has(), Reflect.isExtensible(), Reflect.ownKeys(), Reflect.preventExtensions(), Reflect.set(), Reflect.setPrototypeOf().

Library declarations
JavaScript
// ECMAScript 2015 (ES6)
Reflect.get(target, propertyKey)
Reflect.get(target, propertyKey, receiver)

// target      : an object
// propertyKey : a string or a symbol
// receiver    : optional, the this value for a getter
// returns     : the value of the property
// throws      : TypeError if target is not an object

Parameters

ParameterDescription
targetRequired. The object to read from. If it is not an object, a TypeError is thrown.
propertyKeyRequired. The name of the property: a string or a symbol. Numbers are turned into strings.
receiverOptional. The value to use as this when the property is a getter. It defaults to target.

Return Value

Return ValueDescription
Any valueThe value of the property. Inherited properties from the prototype are found too. If the property does not exist, you get undefined.
TypeError (thrown)target is not an object, for example a number or a string.

JavaScript Examples

Example 1 — Read Properties

Read an object property, a missing property, an array item, an array length and a symbol key.

JavaScript
const user = { name: "Ann", age: 30 };
const tag = Symbol("tag");
const item = { [tag]: "secret" };

console.log("name: " + Reflect.get(user, "name"));
console.log("city: " + Reflect.get(user, "city"));
console.log("array item: " + Reflect.get([10, 20, 30], 1));
console.log("array length: " + Reflect.get([10, 20, 30], "length"));
console.log("symbol key: " + Reflect.get(item, tag));
Try It Yourself

How It Works

  1. Same as dot notation. Reflect.get(user, "name") gives "Ann", just like user.name. A property that does not exist gives undefined.
  2. Arrays are objects. Items and "length" are properties of the array, so get() reads them in the same way.
  3. Symbols work as keys. The property key can be a symbol, here tag.

Example 2 — Getters and the Receiver

A getter reads this. The receiver decides what this is.

JavaScript
const person = {
  first: "Ann",
  get hello() {
    return "Hi " + this.first;
  }
};
const other = { first: "Bob" };

console.log("Normal: " + Reflect.get(person, "hello"));
console.log("With receiver: " + Reflect.get(person, "hello", other));
console.log("Plain value ignores receiver: " + Reflect.get(person, "first", other));
Try It Yourself

How It Works

  1. A getter. hello is a getter that builds text from this.first. By default this is the object itself, so you get "Hi Ann".
  2. Change this. With other as the receiver, the getter runs with this set to other, so it reads "Bob".
  3. Plain values ignore it. first is a normal data property, so the receiver makes no difference.

Example 3 — Inherited Properties and Errors

Properties from the prototype are found. Primitive values are not accepted. The catch block prints the error type only.

JavaScript
const parent = { greeting: "Hello" };
const child = Object.create(parent);
child.name = "Ann";

console.log("Own: " + Reflect.get(child, "name"));
console.log("Inherited: " + Reflect.get(child, "greeting"));
console.log("toString is a function: " + (typeof Reflect.get(child, "toString")));

try {
  Reflect.get("abc", "length");
} catch (err) {
  console.log("String target: " + err.name);
}
console.log("Dot notation: " + "abc".length);
Try It Yourself

How It Works

  1. Own and inherited. get() looks at the object first and then up the prototype chain, so greeting and even toString are found.
  2. Primitives are rejected. A string is not an object, so Reflect.get("abc", "length") throws a TypeError.
  3. Dot notation is more relaxed. "abc".length works because JavaScript quietly wraps the string in an object first.

Browser & Runtime Support

Reflect.get() is part of ES2015 (ES6), together with the Reflect object. Every current browser and Node.js has it.

✓ ES2015 · Widely supported

Reflect.get()

Supported in Chrome 49+, Edge 12+, Firefox 42+, Safari 10+, Opera 36+ and Node.js 6+. Internet Explorer never got it.

ES2015 Standard since
Google Chrome 49+ · Desktop & Mobile
Full support
Microsoft Edge 12+ · Chromium and legacy
Full support
Mozilla Firefox 42+ · Desktop & Mobile
Full support
Apple Safari 10+ · macOS & iOS
Full support
Opera 36+ · Chromium based
Full support
Samsung Internet Recent versions · Android
Supported
Android WebView 49+ · Chromium based
Supported
Node.js 6+ · Server runtime
Supported
Deno Supported · JavaScript runtime
Supported
Bun Supported · JavaScript runtime
Supported
Internet Explorer No native support
Not supported
Reflect.get() Excellent

Bottom line: Safe to use in every current browser and in Node.js. The only thing to plan for is Internet Explorer, which has no Reflect at all.

Frequently Asked Questions

It reads a property from an object and returns its value, like obj[key], but as a function call. It also accepts a receiver, the value to use as this when the property is a getter.
The receiver is the value of this inside a getter. By default it is the target object. In a Proxy get trap you pass the proxy as the receiver, so that getters read other properties through the proxy as well.
The result is the same for objects. Reflect.get() is a function, supports a receiver, accepts symbols and computed keys easily, and throws a TypeError if the target is not an object, while obj.property works on primitives too.
You get undefined, not an error. Use Reflect.has(target, key) if you need to know whether the property exists at all.
Inside a get trap, return Reflect.get(target, key, receiver) to read the property in the normal way. You can add logging or checks before it without breaking getters.

Next: Reflect.getOwnPropertyDescriptor()

Learn how to look at the value and the flags of a property, such as writable and enumerable.

Reflect.getOwnPropertyDescriptor() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

13 people found this page helpful