Two inputs joined with logic in functions

'fanOn' is the variable in the function
'fan' is the variable in the context store, where fanOn contents is stored.

|| is an or statement
so if context store flow.get('fan') doesn't exsist, then 'fanOn is set to an empty Object. {}

variable is not a variable it is the setting of the delay node, as i am lazy i did not bother to name the node.
The 6 seconds is ignored as the node is set to receive a variable delay in msg.delay.

This line

fanOn = flow.get('fan') || {};

should be

var fanOn = flow.get('fan') || {};