michelle_burke
2d ago • 0 views
Hey everyone! 👋 Struggling a bit with JavaScript's arithmetic operators? They're super fundamental for doing any kind of math in your code. Let's dive into some examples and then test our knowledge to really make sure we've got them down! 💻
💻 Computer Science & Technology
1 Answers
✅ Best Answer
douglasortiz1996
Mar 23, 2026
🧠 Quick Study Guide: JS Arithmetic Operators
- ➕ Addition (`+`): Used to sum two operands. Example: `5 + 3` evaluates to `8`.
- ➖ Subtraction (`-`): Used to find the difference between two operands. Example: `10 - 4` evaluates to `6`.
- ✖️ Multiplication (`*`): Used to multiply two operands. Example: `6 * 2` evaluates to `12`.
- ➗ Division (`/`): Used to divide two operands, returning the quotient. Example: `15 / 3` evaluates to `5`.
- 🔢 Modulus (`%`): Returns the remainder of a division operation. Example: `10 % 3` evaluates to `1`.
- 💡 Exponentiation (``): Raises the first operand to the power of the second (ES2016+). Example: `2 3` evaluates to `8`.
- ⬆️ Increment (`++`): Increases an operand's value by one. Can be prefix (`++x`) or postfix (`x++`). Example: `let x = 5; x++;` results in `x` being `6`.
- ⬇️ Decrement (`--`): Decreases an operand's value by one. Can be prefix (`--y`) or postfix (`y--`). Example: `let y = 8; y--;` results in `y` being `7`.
- ⚖️ Operator Precedence: JavaScript follows standard mathematical rules (like PEMDAS/BODMAS). Parentheses `()` can be used to override default precedence.
📝 Practice Quiz: Test Your Knowledge
1. Which JavaScript operator returns the remainder of a division?
/%*
2. What will be the output of console.log(10 + "5"); in JavaScript?
15"105"Error5
3. Consider the following JavaScript code:let a = 7; b;
let b = 2;
let result = a
What is the value of result?
914493.5
4. If let x = 10; and then x--; is executed, what is the new value of x?
10119Error
5. What is the result of (5 + 3) * 2 in JavaScript, considering operator precedence?
1613108
6. Which operator is used for multiplication in JavaScript?
x*.m
7. What will console.log(10 / 3); output in JavaScript?
33.333...1Error
Click to see Answers
1. C
2. B
3. C
4. C
5. A
6. B
7. B
Join the discussion
Please log in to post your answer.
Log InEarn 2 Points for answering. If your answer is selected as the best, you'll get +20 Points! 🚀