I would like to have on a separate script some logic and I need to let it know on which global variable all of my operations must be done: how can I pass to a function a reference to the variable?
function setVariable(variable){
//Here I let the script know on which variable it should work
//Example var x = reference to 'variable'
}
function run(){
if(x === 0){ ...
... }
}
I cannot "copy" the variable value because it's global and it can change anytime and this script has to read the updated value.