Variables let programs remember information. Data types describe what kind of information is being stored, such as text, numbers, or true/false values.
Nearly every program depends on storing data, updating it, and passing it around. Understanding the difference between a variable, a value, and a type is one of the first core programming skills.
const username: string = "Ruben";
let score: number = 0;
let isLoggedIn: boolean = true;
score = score + 10;
console.log(username);
console.log(score);
console.log(isLoggedIn);
const when a variable should not be reassigned
let when a value needs to change over time
const studentName = "Mia";
const age = 16;
const isEnrolled = true;
console.log(`${studentName} is ${age} years old.`);
console.log(`Enrolled: ${isEnrolled}`);