O'Reilly logo

Definitive VoiceXML™ by David Cuddihy, Adam Hocek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A.3. Operators

An operator performs some computation on one or more variables. Operators can be classified as assignment, comparison, conditional, boolean, arithmetic, string, bitwise, and special. These operators are summarized in Table A-3

Table A-3. ECMAScript operators
OperatorsDescriptionExamples
assignment = += -= *= /= %= <<= >>= >>>= &= ^= |= These operators assign a value to a variable.
x = 3; 
y = fibonacci(10);
x = "Hello."
x = y;
x += y  // fills x with x + y
x *= y  // fills x with x * y
comparison == != > >= < <= These operators represent a relation between two expressions, evaluate to a boolean.
x <= 10
5 != 4  // always evaluates 
        // to true
conditional ? :This operator is a shorthand for if-then-else logic.
 y = (x < 0) ? 0 : x; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required