0
0
Javascriptprogramming~20 mins

Arithmetic operators in Javascript - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Arithmetic Operator Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of mixed arithmetic operations
What is the output of the following JavaScript code?
Javascript
const result = 10 + 5 * 2 - 8 / 4;
console.log(result);
A16
B24
C18
D20
Attempts:
2 left
💡 Hint
Remember the order of operations: multiplication and division happen before addition and subtraction.
Predict Output
intermediate
2:00remaining
Result of increment and decrement operators
What will be logged to the console after running this code?
Javascript
let x = 5;
console.log(x++ + ++x);
A12
B11
C10
D13
Attempts:
2 left
💡 Hint
Remember that x++ uses the value before increment, ++x increments before use.
Predict Output
advanced
2:00remaining
Output with modulus and exponentiation
What is the output of this code snippet?
Javascript
const a = 7 % 3;
const b = 2 ** 3;
console.log(a + b);
A9
B11
C10
D8
Attempts:
2 left
💡 Hint
Calculate modulus and exponentiation separately, then add.
Predict Output
advanced
2:00remaining
Division and floating point precision
What will this code output?
Javascript
console.log(0.1 + 0.2 === 0.3);
ATypeError
Bfalse
Ctrue
Dundefined
Attempts:
2 left
💡 Hint
Think about how computers handle decimal numbers.
🧠 Conceptual
expert
3:00remaining
Understanding operator precedence and associativity
Consider the expression: 4 + 3 * 2 ** 2 / 4 - 1. What is the final value?
A8
B7
C9
D6
Attempts:
2 left
💡 Hint
Remember the order: exponentiation, multiplication/division, addition/subtraction, and left-to-right associativity for same precedence.