Arithmetic Operators
In this lesson, we will dive into some arithmetic operators in JavaScript.
We'll cover the following...
We'll cover the following...
JavaScript supports the following binary arithmetic operators:
add (+), subtract (–), multiply (*), divide (/), and modulus (%).
With numeric values, all operators work just as you expect them.
Except for the add operator, all others work with non-numeric values by casting the operands to a Number value.
The uniqueness of the + operator
The add operator is a bit different:
If one of the operands is a string, the result of the ...