I have initialized a variable:
var isTrueOrFalse; 
//Called when button add in page1 is clicked
function ExecuteThis(){
   isTrueOrFalse = true;
}
//called when button remove in page1 is clicked
function ExecuteThat(){
 isTrueOrFalse = false;
}
Then I have a function that validates if isTrueOrFalse is false or true
//Called when page2 onLoad
function NowChange(){
 if(isTrueOrFalse == true){
 //dostuff
 }else{
 //do this stuff instead
 }
}
The console returns that isTrueOrFalse is undefined. So my question is, how do I define a global variable inside a function and pass the value of it to another function?(NowChange())
 
    