So, when you reassign a variable, it copies the value. Always. That’s how that part of JS works.
If you have an object, the thing the variable points to is the reference: it’s not the whole thing you write in the code, it’s just a value that says “this is an object and it has these properties and these properties are stored somewhere”. So if you reassign it, it still copies it. It is just a value, and it still gets copied in exactly the same way as a number or a string.
But the contents of the object aren’t stored in the same place. If you copy the reference to that object, it will still point at the same contents. If you wanted copies of the contents you would need to copy the contents individually as well, they are seperate things.
It’s a sense it’s like a physical bag. It’s still the same bag regardless of what items you put into it, it doesn’t change into a new bag every time you put something into it or take something out. The contents are seperate things to the bag itself. (Edit: this analogy is really bad in context now I think about it. Sorry! It’s like a bag that can be cloned, but if you clone it the contents don’t clone, they’re the same exact contents, and that doesn’t really make sense )