# Getter

*noun*

say it: **“GET-er”** **/ˈɡɛtər/**

A method marked with get that runs when code reads a property, so ship.shields can return a hidden value or work one out.

## What is **Getter** in JavaScript?

**Getter** — A method that returns an object's stored value.

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

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

## In a sentence

- “I added a **getter** so other code can read pet.age even though the real value is private.”

Level: Journeyman · [More JavaScript terms at this level](https://www.ask-codey.com/glossary?category=javascript&level=3)

Updated: November 9, 2026

## In other subjects

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

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