Wherein our hero, Debugging Dave, learns about the perils of nested scopes.
// Example of variable scope in action
var x = 5;
{
var x = 10;
console.log(x); // Output: 10
}
console.log(x); // Output: 5
Don't forget, scope is like a big ol' box that contains your variables. If you try to access something outside the box, you'll get a "ReferenceError".
And don't even get us started on block scope...