Operators

Assignment operator (=)

Try the free JavaScript compiler

Evaluates the right-hand value and attempts to assign it to the left-hand reference. It is not an equality comparison. Assignment to a const binding throws; property assignments also depend on property semantics and strictness.

Formal Syntax & Structure

javascript syntaxjavascript
target = expression

Parameters & Attributes

NameTypeDescription
targetassignment targetAssignable reference.
expressionexpressionValue to assign.

Working Example

Example Snippetjavascript
let total = 3;total = 10;console.log(total);
JavaScript Reference