As expected, the last console.log() statement will produce a ReferenceError because x is only defined (scoped) inside the foo() function.
function foo ( x ) { let y ; if ( x === 1 ) { y = 2 ; } console.