I was reading the Scopes and Closure of You don't know JS book by Kyle Simpson, specifically this topic Error.
function foo(a) {
console.log( a + b );
b = a;
}
foo( 2 );
This example results in reference error. In the book, it said that "b" is not found in the scope. Can anyone help me realize why "b" is not found in that scope?