For example, if we have:
let totalCost = 1 + 3 * 10;
then readers may be confused about which operation comes first.
However, we can make everyone’s lives easier by wrapping parentheses around expressions that have higher precedence.
For example, we can write:
let totalCost = 1 + (3 * 10);
then we wrap the expressions around the multiplication.
Now we know the multiplication operation comes first.
If we move the parentheses, then the operations would be done in a different order.
For instance, if we have:
let totalCost = (1 + 3) * 10;
then the addition is done before the multiplication.