michelle_burke
michelle_burke 2d ago • 0 views

Examples of Arithmetic Operators in JavaScript

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
🪄

🚀 Can't Find Your Exact Topic?

Let our AI Worksheet Generator create custom study notes, online quizzes, and printable PDFs in seconds. 100% Free!

✨ Generate Custom Content

1 Answers

✅ Best Answer
User Avatar
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?

  1. /
  2. %
  3. *

2. What will be the output of console.log(10 + "5"); in JavaScript?

  1. 15
  2. "105"
  3. Error
  4. 5

3. Consider the following JavaScript code:
let a = 7;
let b = 2;
let result = a
b;
What is the value of result?

  1. 9
  2. 14
  3. 49
  4. 3.5

4. If let x = 10; and then x--; is executed, what is the new value of x?

  1. 10
  2. 11
  3. 9
  4. Error

5. What is the result of (5 + 3) * 2 in JavaScript, considering operator precedence?

  1. 16
  2. 13
  3. 10
  4. 8

6. Which operator is used for multiplication in JavaScript?

  1. x
  2. *
  3. .
  4. m

7. What will console.log(10 / 3); output in JavaScript?

  1. 3
  2. 3.333...
  3. 1
  4. Error
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 In

Earn 2 Points for answering. If your answer is selected as the best, you'll get +20 Points! 🚀