global and function scoped

node v10.16.0
version: master
endpointsharetweet
// Initialize a global variable var digimon = "Agumon"; function evolution() { // Initialize a local, function-scoped variable var digimon = "Greymon"; console.log(digimon); } // Show the result console.log(digimon); evolution(); console.log(digimon);
Loading…

no comments

    sign in to comment