In JS, variables referring to non-primitives are really references (addresses) to that spot in memory. That is why JS calls them “reference types”. So you are exporting a reference to that spot in memory and then you are changing the data at that spot in memory. If I have a 2 room house and then give someone my address and then I add a room, when my friend visits he will see 3 room house - it doesn’t matter that the house had 2 rooms when I gave them the address. It is not a separate house. When I export a reference, the import stores a copy of the reference. It doesn’t make a complete copy of what the reference is pointing to. Just like adding a room to my house just modifies the house, it doesn’t create a completely new house.