A constant is like a variable, except its value can never change after it's set. Use a constant whenever a value should stay fixed for the life of the program — it protects you from accidentally overwriting something you didn't mean to.
In JavaScript, use const instead of let:
const pi = 3.14159;
const siteName = "Learn Computer Academy";
console.log(pi); // 3.14159Trying to reassign a constant is an error — JavaScript stops you on purpose:
const pi = 3.14159;
pi = 3.14; // ❌ TypeError: Assignment to constant variable.A common habit among experienced programmers: default to const, and only switch to let when you know a value genuinely needs to change later (like a counter or a score). It makes code easier to reason about — if you see const, you know that value is fixed for good.