| | | | Operators in descending precedence: Operators | Comments | ( ) [ ] | | ! + - ++ -- & sizeof | Unary pre/postfixes. & is only allowed in parameter lists | * / \ % | \ is integer divide | - + | | With + one or both operands may be a string (non-numeric) whereby string concatenation is performed instead of a numeric add. | is the string concatenation operator. | < <= > >= | If one or both operands are strings, a literally string-compare will take place. | == != | If one or both operands are strings, a literally string-compare will take place. | && | Evaluation of A && B: In CSS, B will allway be evaluated. In C/C++, B will only be evaluated if A is true. | || | Evaluation of A || B: In CSS, B will allway be evaluated. In C/C++, B will only be evaluated if A is false. | = += -= *= /= \= %= |= | With += source or target may be a string (non-numeric) whereby string concatenation is performed instead of a numeric add. | , | Comma is used to group several expressions into a single statement. | There are no bitwise (| & ^^ ~~) and no conditional (? :) operators in CSS. Expressions true/false evaluation: - if the expression is a number, zero values are false and nonzero values are true.
- if the expression is no number, empty strings are false and nonempty are true.
The sizeof operator returns 1 for simple var's. For arrays it returns the number of elements for the given index: var xy[5][4];
sizeof(xy); // 20
sizeof xy[1]; // 4
sizeof xy[2][3]; // 1
|