Damn Colin,
you are right. I hadn't thought about that.
Did a little test where I only initialize the array on context memory once, and from then on I only get
the array but I don't set
it anymore:
var myArray = context.get("myArray");
if(!myArray) {
console.log("Set the array on context memory");
context.set("myArray", []);
myArray = context.get("myArray");
}
myArray.push(msg.payload);
msg.payload = myArray;
return msg;
So the get
returns a reference to the array on the context memory, which means I don't have to set
it after I have changed it.
I understand that it works like this in an in-memory context storage, but not with other kind of storages.
For example when I have an File-base storage, I don't see how it could work unless there is a caching layer that keeps all objects into memory. Or I am just getting nuts 
@TizaouiT: I hope you don't mind that we dive a bit deeper... Hopefully your question is already answered in our posts above? If you do it like in @Colin's example (i.e. always set
the array to context after changing), it will work fine...