3 ms·
> no `let`. only `var`. compiler can optimize further. This is not an "additional feature" so much as removing a feature. One reason a programmer might declare
by giaour 2y ago
> no `let`. only `var`. compiler can optimize further.
This is not an "additional feature" so much as removing a feature. One reason a programmer might declare something to be a constant is to prevent the symbol from being rebound. You're right that one consequence of using `let` instead of `var` is that the compiler can more aggressively optimize constants, but the primary consequence is to capture and enforce the programmer's intent that the binding be immutable.
- Hashex129542 2y agoYes, got it. Thanks :)