June 2025
Beginner
817 pages
31h 30m
English
Like any other programming language, JavaScript has all the common arithmetic operators for numerical calculations on board. Table 17.3 provides an overview of the arithmetic operators in JavaScript.
|
Operator |
Meaning |
Example |
|---|---|---|
|
+ |
Addition |
a = b + c; |
|
- |
Subtraction |
a = b – c; |
|
* |
Multiplication |
a = b * c; |
|
/ |
Division |
a = b / c; |
|
% |
Remainder of a division |
a = b % c; |
Table 17.3 Overview of the Arithmetic Operators
The use of arithmetic operators is relatively simple, as the following example shows:
let val1 = 101 + 202;console.log(val1); // Output: 303console.log(88 - 22); // Output: 66let val2 = val1 * 3;console.log(val2); // Output: ...
Read now
Unlock full access