Arithmetic Operators
👨💼 Great! You can now perform calculations in JavaScript.
🦉 Some things to note:
- Division always returns a decimal in JavaScript (no integer division)
- The modulo operator (
%) is great for checking if a number is even or odd:number % 2 === 0means it's even - You can combine operators:
(a + b) * c
JavaScript follows the standard order of operations (PEMDAS): Parentheses,
Exponents, Multiplication/Division, Addition/Subtraction. Use parentheses to
be explicit about order!