Recall & Review
beginner
What is a variable in programming?
A variable is like a labeled box where you can store information to use later in your program.
Click to reveal answer
beginner
Why do we need variables in JavaScript?
Variables let us save data so we can use, change, or refer to it anytime while the program runs.Click to reveal answer
beginner
How do variables help in making programs flexible?
Variables let programs work with different values without changing the code, like using a name variable to greet anyone.Click to reveal answer
beginner
What happens if you don’t use variables and hardcode values instead?
Without variables, you must rewrite or copy code for every value, making programs long, hard to fix, and less useful.
Click to reveal answer
beginner
Give an example of a simple variable declaration in JavaScript.
Example: <code>let age = 25;</code> Here, <code>age</code> is a variable storing the number 25.Click to reveal answer
What does a variable do in a program?
✗ Incorrect
Variables store data so the program can use or change it later.
Which keyword is used to declare a variable in JavaScript?
✗ Incorrect
The keyword
let declares a variable in JavaScript.Why is using variables better than writing values directly multiple times?
✗ Incorrect
Variables let you update values in one place without changing many lines.
What is stored inside a variable?
✗ Incorrect
Variables can store many types of data, including numbers and text.
What happens if you change the value of a variable?
✗ Incorrect
Changing a variable updates it to hold the new value.
Explain in your own words why variables are important in programming.
Think about how you might save your name or age to use later in a program.
You got /4 concepts.
Describe what would happen if you wrote a program without using any variables.
Imagine writing your name many times instead of saving it once.
You got /4 concepts.