global var concept

node v10.16.0
version: master
endpointsharetweet
var trigger = true; // Initialize a global variable var digimon = "Agumon"; if (trigger) { // Attempt to create a new variable in a block var digimon = "Greymon"; console.log(`Evolution triggered, you are become ${digimon}.`); } console.log(`Evolution failed, you are still ${digimon}.`);
Loading…

no comments

    sign in to comment