4 ms·
That's a misnomer, not a misgiving. val/var/const/whatever only describe the reference, not the value. It doesn't really make sense for that annotation to, say
by always_good 9y ago
That's a misnomer, not a misgiving.
val/var/const/whatever only describe the reference, not the value. It doesn't really make sense for that annotation to, say, swivel a collection between ImmutableList and MutableList.
Now, you might be right that it's confusing, this difference between reference mutability and value mutability. I see beginners struggle with it in Javascript's new let vs const all the time.
- idbehold 9y agoEven with Object.freeze() it only prevents mutation of the top-level keys.