Comma(,) special operatorS2C Home « Operators « Comma(,) special operator
Expression operator.
Description
The Comma(,)
special operator allows use of mutiple expressions where an expression is required.
Syntax
Signature | Description |
---|---|
expression1, expression2 | Use of mutiple expressions where an expression is required. |
Parameters
Parameter | Description |
---|---|
expression1, expression2 | The expressions we wish to replace a single expression. |
Examples
Following is an examples of the Comma(,)
special operator, which changes two expression counters to produce part of the 9 times table.
// The comma(,) operator.
var tableArray = new Array(10);
for (var i = 0, j = 9; i < 10; i++, j--) {
tableArray[i] = i + "" + j;
}
alert(tableArray);
Related Tutorials
General use.