numbers, but you can also perform other advanced mathematical calculations.
The four basic mathematical operations are as follows:
• Addition: For instance, 10 + 20
• Subtraction: For instance, 20 – 10
• Multiplication: For instance, 10 * 20
• Division: For instance, 20 / 10
In addition, you can build complex mathematical expressions using combinations of these operations. For instance, the following expression subtracts 10 from the
result of 100 divided by 5:
100 / 5 – 10
You can override the order of operation with parentheses. Consider the following mathematical expression:
100 / (5 – 10)
This will calculate the value of 100 divided by the result of subtracting 10 from 5.
There are two important points to note about these sorts of mathematical expressions:
var myVariable = 100 / 5;
var myVariable = 100 / thisVar;