What's the difference between let and const in JavaScript?
Ask QuestionAsked 3 days agoViewed 1.7k times
When should I reach for one over the other? Are there performance implications I should know about?
MW
3 Answers
- ✓✓ Accepted answer
const cannot be reassigned; let can. Both are block-scoped. There is no meaningful performance difference between them.
LO Note const still allows mutating the object it points at — it only freezes the binding, not the value.
PNPrefer const by default; reach for let only when you genuinely reassign. It makes intent clearer to readers.
MW