var x = 10 + 5 * 2;
In the above example, what is the value of x?
var x = (10 + 5) * 2;
When using parentheses, the operations inside are calculated first. In the above example, x = 30.
var x = 10 + 5 - 2;
When operations have the same precedence (like addition and subtraction), they are calculated from left to right:
In the above example, x = 13.
|1||( )||Expression grouping||(10 + 5)|
|2||*||Multiplication||10 * 5|
|2||/||Division||10 / 5|
|2||**||Exponentiation||10 ** 5|