What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-14 11:44:08
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" Add solution