O'Reilly logo

JavaScript Quick Syntax Reference by Mikael Olsson

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

CHAPTER 3

image

Operators

An operator is a symbol that makes the script perform a specific mathematical or logical manipulation. The operators in JavaScript can be grouped into five types: arithmetic, assignment, comparison, logical, and bitwise operators.

Arithmetic Operators

The arithmetic operators include the four basic arithmetic operations, as well as the modulus operator (%) that is used to obtain the division remainder.

x = 3 + 2; // 5 - additionx = 3 - 2; // 1 - subtractionx = 3 * 2; // 6 - multiplicationx = 3 / 2; // 1.5 - divisionx = 3 % 2; // 1 - modulus (division remainder)

Assignment Operators

The second group is the assignment operators. ...

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