assignment
Summary
The assignment operator takes the value of the right operand and assigns it to the left operand.
Syntax
result = expression;
- result
- Any variable.
- expression
- Any expression that returns a value.
Examples
var x;
x = 5;
Remarks
The = operator behaves like other operators, so expressions that contain it have a value. This means that you can chain assignment operators as follows: j = k = l = 0
. In this case j
, k
, and l
equal zero.
Attributions
Microsoft Developer Network: Article