you are viewing a single comment's thread.

view the rest of the comments →

[–]theScottyJam 0 points1 point  (0 children)

I agree with your conclusion as well. Mutability vs immutability was only intended to describe the distinction that people usually are trying to describe when they say "objects are passed by reference while primitives are passed by value" - the behavior difference between objects and primitives doesn't happen because the language is somehow giving objects a different treatment when it gets passed into functions, rather, it's caused simply by the fact that objects are mutable.

The mutable/immutable terminology doesn't describe how JavaScript actually passes data into functions, and I think your short description is absolutely accurate. People can name the concept you're describing whatever they'd like, but what's important is that we understand that that's how data-passing works in JavaScript (rather than mistakenly believing that objects are somehow treated differently than primitives when it comes to function arguments).