# Setter

A method that validates or changes an object's stored value.

## What is **Setter** in JavaScript?

**Setter** — A method that validates or changes an object's stored value.

```javascript
class Thermostat {
    #temperature = 20;

    get temperature() {
        return this.#temperature;
    }
}
```

Level: Journeyman · [More JavaScript terms at this level](https://www.ask-codey.com/glossary/subjects/javascript/journeyman)

Updated: September 27, 2026

## In other subjects

- [Setter in C#](https://www.ask-codey.com/glossary/setter-c-sharp)
- [Setter in Java](https://www.ask-codey.com/glossary/setter)
- [Setter in OOP](https://www.ask-codey.com/glossary/setter-oop)

Source: https://www.ask-codey.com/glossary/setter-javascript
