var x=21; var myFunction = function(){ console.log(x); var x= 20; }; myFunction(); code example
Example: var x=21; var myFunction = function(){ console.log(x); var x= 20; }; myFunction();
var x=21;
var myFunction = function(){
console.log(x);
var x= 20;
};
myFuntion();