const
const declares a name that always points to the same value: you cannot reassign it later.
const creates a variable and gives it a value on the same line, as in const city = "Bogotá";. After that, the name cannot point to another value. If you try, TypeScript warns you before running, and Node throws a TypeError if the code does run.
Note that const fixes the name, not the contents. If the value is an object or an array, you can change its properties or add items. What you cannot do is make the name point to a different object.
The course uses const in almost every lesson. The reason is practical: when you read code and see const, you know that name does not change further down. There is less to track in your head. When you truly need to reassign, you use let.
Without an annotation, TypeScript infers the type from the value. With const city = "Bogotá", it infers the literal "Bogotá".
Reach for it when: Reach for it by default, for any variable you do not need to reassign. Switch to `let` only when the value must change.
Examples
Common mistake
const count = 1; count = 2; console.log(count);
Why: A `const` cannot be reassigned. TypeScript catches it; in Node it would be a `TypeError`.
How to write it: Use let count = 1; if the value must change, or create another const with a different name.
