What you need to know
var is function-scoped and can be redeclared, which can make code harder to reason about. let and const are block-scoped; const prevents rebinding while still allowing object contents to change.
How to apply it
Use const by default when a variable will not be reassigned, and let when reassignment is part of the logic. Keep variables close to where they are used and choose names that explain their role.
Common mistake to avoid
Do not assume const makes an object immutable. Avoid mutating shared data unexpectedly, and use tools or patterns that make data changes visible.
