Skip to content

PRO TIP Block youtube.com at the DNS level โ€” Pi-hole, NextDNS or your hosts file โ€” but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Learn JavaScript VARIABLE SCOPE in 5 minutes! ๐Ÿ 

58.1K views on YouTube

// variable scope = where a variable is recognized
// and accessible (local vs global)

let x = 3; // global scope

function1();

function function1(){
let x = 1; // local scope
console.log(x);
}

function function2(){
let x = 2; // local scope
console.log(x);
}