variable scope = where a variable is recognized and accessible
- local
- global
Local scope: in this case, the variable can’t pass through different functions
function function1(){
let x = 1;
console.log(y);
}
function function2(){
let y = 2;
console.log(x);
}