Logic error - can i get some input please?

When using a node like the change node you can select the storage option with the icon on the right side.

r-01

When using JavaScript statement inside a function node then you follow the explanation given in this link (multiple context stores):

https://nodered.org/docs/writing-functions#storing-data