Global.put not needed as variable altered by reference?

JavaScript passes objects around by reference rather than by value. So the call to global.get() returns a reference to the object in context. Any modification of the object will modify the object in context.

If you want to modify the object without modifying what is in context, you have to clone it first. We provide the RED.util.cloneMessage function that can be used for this:

var value = RED.util.cloneMessage( global.get("myValue") );