# Immutability

> Data that cannot change once made. To change it, you make a new copy.

**Field:** Software Development  
**Category:** Programming Paradigms  
**Also known as:** Immutable, Immutable Data

## Think of it like

Think of it like a printed photo. To change it, you print a new one and keep the old.

## Definition

Immutability means a value cannot change after it is made. To get a different value, you make a new one. The old one stays as it was. Python's text and tuples work this way, and JavaScript can freeze an object. Nobody can change data behind your back while you use it. Many tools use this to spot changes fast, by checking if a value is new.

## Example

Jack freezes a point with x set to 1. A later line tries to set x to 5, and x is still 1.

## Example code

```javascript
const point = Object.freeze({ x: 1 });
point.x = 5;
console.log(point.x); // 1
```

The frozen object ignores the change.

## Why it matters

Data that never changes cannot be broken by code far away.

## Common mistake

Thinking const makes an object immutable. const stops you swapping the box, not changing what is in it.

## Three principles

- **Fixed once made.** No edits in place.
- **New copy instead.** The old one stays.
- **Safe to share.** Nobody can change it.

## Related terms

- [Functional Programming](https://learn.benibix.com/term/development/functional-programming)
- [Pure Function](https://learn.benibix.com/term/development/pure-function)
- [Constant](https://learn.benibix.com/term/development/constant)
- [Side Effect](https://learn.benibix.com/term/development/side-effect)

---

Source: https://learn.benibix.com/term/development/immutability
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
