Lesson 2 of 20
Variables & Types
Use const and let to store values.
Introduction
Prefer const when a variable binding will not be reassigned and let when it needs to change.
JavaScript values include strings, numbers, booleans, objects, arrays, null and undefined.
Key insight
Use const and let to store values.
Example
const name = "Asha";
let score = 10;
score += 5;
console.log(name, score);This example shows the core variables & types idea in a small, runnable program.
Real-world example
Variables & Types appears in everyday application code, scripts and APIs.
Test yourself
2-question check
1
What is the main idea in Variables & Types?
2
Where can variables & types be useful?
Ready to check your understanding?
Answer every question, then submit your quiz.
Try it yourself
JavaScript compiler
Runs in your browser. Nothing is sent to a server.
Output appears here
Practice challenge
Create a const projectName and a let progress value.