Assign value (=) (Operator/assignment)

Assign one operand to a left value.

Availability:

ECMAScript edition - 2
JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Netscape Enterprise Server - 2.0
Opera - 3.0
Property/method value type:Depends on right value
JavaScript syntax:-anLValue = anExpression
Argument list:anExpressionSome operation that yields a suitable value to assign
anLValueA target that can be assigned to

The expression value on the right is assigned to the target operand on the left.

The associativity is right to left.

Refer to the operator precedence topic for details of execution order.

The source expression to the right is called an RValue, the target expression to the left is called an LValue. The LValue must be capable of having something assigned to it and the RVlaue must evaluate to a meaningful and compatible value or a run time exception will be thrown.

Warnings:

See also:= (Assign), Add then assign (+=), Associativity, Concatenate then assign (+=), Equal to (==), Location.assign(), LValue, Multiply then assign (*=), Operator Precedence, Reference, Remainder then assign (%=), Subtract (-), var

Cross-references:

ECMA 262 edition 2 - section - 10.1.3

ECMA 262 edition 2 - section - 11.1.2

ECMA 262 edition 2 - section - 11.13

ECMA 262 edition 2 - section - 12.2

ECMA 262 edition 3 - section - 10.1.3

ECMA 262 edition 3 - section - 11.1.2

ECMA 262 edition 3 - section - 11.13

ECMA 262 edition 3 - section - 12.2