Object in javascript are passed by reference so when you
example = global.get("examnple")
The var example references the same memory as the global var example. So when you alter one you alter the same memory, hence all references to that memory will be the same.
Oh okay, that's why it's not the same behavior with an int, it's because it's not an Object but a primitive ! I thought an array wasn't really an object
Note that it is still good practice to do global.set(). The reason is that if, for example, you use persistent context (so the data are saved between node-red restarts) then node-red uses the set to know that you have changed it so the value must be written to the file the next time the cache is written out.
In 5 years time you might decide that you do, and then might have great difficulty trying to find why the persistent is intermittent.
Also note that it is generally considered best practice to minimise the use of flow and global context. It is very rare to have to use global or flow context. It is usually best to pass data with messages, which is what node red is all about.
Using set/get for globals isn't just about persistence per se. It is about which library is being used to read/write context. There are several available libraries and most require you to use set or they won't work.
So please do always use it. Even the current use with in-memory context is not guaranteed to work in the future. For example, if a future version of Node-RED were to implement change events on context variables, the direct access methods might well stop working.