javascript scope of variables code example
Example 1: global scope js
const color = 'blue'
const returnSkyColor = () => {
return color; // blue
};
console.log(returnSkyColor()); // blue
Example 2: scope in js
// the scope is by default global
var name = 'Hammad';