Arithmetic Operations
Predict Output Beginner
Question
What does this code print?
Code
let result = (10 + 5) * 2 - 8 / 4;
console.log(result);
Hint
Follow order of operations: parentheses, then multiply/divide, then add/subtract.
Explanation
First (10 + 5) = 15. Then 15 * 2 = 30. Then 8 / 4 = 2. Finally 30 - 2 = 28. The output is: 28
Related Resources
Related Lessons
- Numbers and Math
Learn about numbers.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.