---
title: Assignment (=)
slug: Web/JavaScript/Reference/Operators/Assignment
tags:
  - Assignment operator
  - JavaScript
  - Language feature
  - Operator
  - Reference
browser-compat: javascript.operators.assignment
---
{{jsSidebar("Operators")}}

The simple assignment operator (`=`) is used to assign a value to a
variable. The assignment operation evaluates to the assigned value. Chaining the
assignment operator is possible in order to assign a single value to multiple variables.

{{EmbedInteractiveExample("pages/js/expressions-assignment.html")}}

## Syntax

```js
x = y
```

## Examples

### Simple assignment and chaining

```js
// Assuming the following variables
//  x = 5
//  y = 10
//  z = 25

x = y     // x is 10
x = y = z // x, y and z are all 25
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [Assignment
  operators in the JS guide](/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#assignment)
