I am working with rather long strings, and I am worried that when I do
a = "mylongstring"
b = a
that would store the string in memory twice. Since JS strings are immutable, I have no way to verify if it is passed by value (copied) or by reference, and reading about it tells me that "we can assume they are passed by reference, but in actuality it does not matter". Well, it it takes twice the space, it does actually matter, so I'd prefer not assuming. Does it?
N.B. For the story, it is because I have this long string in my React-redux store, and every component listening to changes assigns this string in its own state.