Javascript Reference
Categories: Operators

javascript Operators =

@March 15, 2008, 1:22 a.m.
= Firefox/Netscape/NN 2 IE 3 ECMA 1  

  

The assignment operator assigns the evaluated value of the right-hand operand to the variable on the left. After the operation, the variable contains data of the same data type as the original value. Assignment operations can also be chained, with the evaluation of the entire statement starting from the right and working left. Therefore, after the expression:

a = b = c = 25;

all three variables equal 25.

 
Example
 
var myName = "Theodore Roosevelt";
var now = new Date( );

Powered by Linode.