🟦 TypeScript Variables

TypeScript builds on JavaScript’s let and const keywords, adding optional static typing for variables.

📚 Example Code: Declaring Variables

Console output will appear here...
💡 Use let for reassignable variables and const for values that shouldn’t change.

đź”§ Type Annotations

đź“‘ Type Inference

If no explicit type is given, TypeScript infers it from the assigned value:

let city = "New York"; // inferred as string
let score = 100;       // inferred as number
  
⚠️ Type inference is powerful, but explicit annotations help clarify your intent — especially on larger projects.