---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# Reflect.set()

The static **`Reflect.set()`** method works like setting a
property on an object.

## Syntax

```js
Reflect.set(target, propertyKey, value)
Reflect.set(target, propertyKey, value, receiver)
```

### Parameters

- `target`
  - : The target object on which to set the property.
- `propertyKey`
  - : The name of the property to set.
- `value`
  - : The value to set.
- `receiver` _**optional**_
  - : The 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.

### Return value

A `Boolean` indicating whether or not setting the property was successful.

### Exceptions

A [`TypeError`](../../globals/TypeError/TypeError.mdx), if `target` is not an
`Object`.

## Description

The `Reflect.set` method allows you to set a property on an object. It does
property assignment and is like the
[property accessor](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/Property_Accessors) syntax as a function.
