3 ms·
Reassignment is mutation. It's really not... on a spectrum of mutability. JavaScript const objects allowing mutation of internal data is vaguely on that spectru
by eyelidlessness 7y ago
Reassignment is mutation. It's really not... on a spectrum of mutability. JavaScript const objects allowing mutation of internal data is vaguely on that spectrum, even though it's misleading and confusing. Literally reassigning a variable isn't even up for debate.
- recursive 7y agoEveryone says strings in java are immutable, yet you can still re-assign to string variables. It really is up for debate.
- eyelidlessness 7y agoJava strings are immutable. Java variables with a string type are not. It's really not up for debate. You can't mutate a string in Java (you can in Ruby), but you can mutate a string variable by reassigning it.
- recursive 7y agoOh, I see the distinction now.