SLSkillLoop
JavaScript practice

JavaScript Variables Practice

JavaScript variables are easier when you practice the difference between names, values, and reassignment. These questions focus on let, const, and simple expressions.

How to practice JavaScript variables

JavaScript variable practice teaches the difference between a name, a value, and a binding. That difference matters when choosing let, const, and reassignment.

Track the value after every statement. If const feels confusing, separate reassignment of the binding from mutation of an object or array stored in that binding.

What to focus on
  • let, const, and block scope
  • Reassignment and updated values
  • Primitive values compared with arrays

Example practice questions

Try these samples, then continue into the JavaScript Practice Labfor guided browser-based practice.

1

Which keyword declares a variable that can be reassigned?

Answer: let

2

Which keyword declares a value you do not plan to reassign?

Answer: const

3

After let count = 2; count += 3; what is count?

Answer: 5

4

What type of value is stored by const name = 'Mia'?

Answer: A string

5

Can a const array have items pushed into it?

Answer: Yes, the array can mutate even though the binding cannot be reassigned.

6

What is the value of total after let total = 1; total = 4?

Answer: 4

7

Which keyword creates a block-scoped variable?

Answer: let or const