Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2016.
The Reflect.set() static method is like the property accessor and assignment syntax, but as a function.
The target object on which to set the property.
propertyKeyThe name of the property to set.
valueThe value to set.
receiver OptionalThe value of this provided for the call to the setter for propertyKey on target. If provided and target does not have a setter for propertyKey, the property will be set on receiver instead. Defaults to target.
A Boolean indicating whether or not setting the property was successful.
Thrown if target is not an object.
Reflect.set() provides the reflective semantic of a property access. That is, Reflect.set(target, propertyKey, value, receiver) is semantically equivalent to:
Note that in a normal property access, target and receiver would observably be the same object.
Reflect.set() invokes the [[Set]] object internal method of target.
When the target and receiver are different, Reflect.set will use the property descriptor of target (to find the setter or determine if the property is writable), but set the property on receiver.
| ECMAScript® 2027 Language Specification # sec-reflect.set |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Apr 11, 2026 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.