3 ms·
If you use let it means you intend to use that binding "later", up to the end of the scope, and within that scope the value shall not change: that's the Whole p
by HelloNurse 7y ago
If you use let it means you intend to use that binding "later", up to the end of the scope, and within that scope the value shall not change: that's the Whole point.
If you want a variable you can assign successive different values to, it's an entirely different thing, and there have always been var and the assignment operator for that.
- heavenlyblue 7y ago>> within that scope the value shall not change: that's the Whole point. That's pure BS. This is only true for atomics, the value can change (under let, var and const) as we can easily see with Array.push, for example.
- pault 7y agoI think you mean `const`. `let` can be reassigned.