4 ms·
> const vs let is an "immutable by default" vs "mutable by default" type of difference Sorta. I mean you're right but at the same time if you're using const fo
by BinaryIdiot 10y ago
> const vs let is an "immutable by default" vs "mutable by default" type of difference
Sorta. I mean you're right but at the same time if you're using const for an object or array then it doesn't really matter without `object.freeze()` because it's not immutable only the reference is and I don't think most JavaScript developers understand that (at least not most of the ones I've run into).
- gotofritz 10y agoNote that Object.freeze only works for shallow objects