Assignment Expression Summary Assign a value to a variable. Syntax variable = expression Parameters variable The variable, property, or array element to be given a value. expression Any legal expression. Description The = operator computes the value of the expression on the right, and then assigns it to the variable, property, or array element on the left. The expression on the right is evaluated prior to assignment: 12int x = 2;x = 3 * x + 5; // x is assigned the value 11 Using the assignment operator, it is also possible to initialize variables later: 12int x;x = 5; Examples Basic Usage 123456import System; int x = 1;Console.log(x); // 1x = 10;Console.log(x); // 10 Delayed Variable Initialization 123456789int x; // Variable not initialized bool maybeTrue = false;if (maybeTrue) { x = 10;}else { x = 50;} See Also Arithmetic Operators Logical Operators Bitwise Operators Share HTML | BBCode | Direct Link