Answers for "why is my variable outside of function is not changing inside of the function in javascript"

0

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"
Posted by: Guest on September-12-2020

Code answers related to "why is my variable outside of function is not changing inside of the function in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language