js overwrite a var outside a function inside a function code example
Example: change a variable outside a function js
var global = "Global Variable"; //Define global variable outside of function
function setGlobal(){
global = "Hello World!";
};
setGlobal();
console.log(global); //This will print out "Hello World"