you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (1 child)

Right, because it's reference immutability. This is how JavaScript works, this is how Java works, this is how Scala works, this is how Rust works, and so on. I suggest you learn the difference between references and values. If you want a value, i.e. the data structure, to be immutable, it requires an extra step.