Predict Variable Reassignment
Predict OutputBeginner
Question
What does this code print?
Code
let count = 5;
count = count + 3;
console.log(count);
Hint
Start with 5, then add 3.
Explanation
The variable count starts at 5. The line count = count + 3 reads the current value (5), adds 3, and stores the result (8) back into count. So console.log(count) prints 8.
Related Resources
Related Lessons
- JavaScript Variables
Learn about let, const, and var in JavaScript.
Related Cheatsheets
- JavaScript Cheatsheet
Quick reference for JavaScript variables.
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.