I understand that they are immutable, but I want to know why they are immutable.
Is there any specific reason as to why JavaScript strings are immutable? Wouldn't it make life easier if they weren't, just like arrays?
I understand that they are immutable, but I want to know why they are immutable.
Is there any specific reason as to why JavaScript strings are immutable? Wouldn't it make life easier if they weren't, just like arrays?