MODULE 1 · Getting started
Reading · 15 min
Variables and values
Variables and values
Variables connect a meaningful name to a value. Good names explain the role of the value, which makes later changes safer.
Learning objectives
- Choose between const and let
- Name values clearly
Store information with names that make a program easier to understand. Focus on explaining each decision in your own words before relying on a pattern or shortcut.
Example
const taxRate = 0.18;
let total = 120;
total = total + total * taxRate;Summary
KEY TAKEAWAYS
- Use const by default and let when reassignment is required.
- Names should describe what a value represents.
Reading material
Variables and values practice prompt
Use the exercise in this lesson to check your understanding.
Your progress is saved on this device. Sign in to keep it across devices.
