Uncaught ReferenceError: y is not defined
undefinedwhereas y throws an error. So what's the difference? Neither variable has been declared when we are accessing them. Why do we only get an error when referencing y?
showVariableValues(). So in reality, our above code will be reorganized as shown below:
undefined, whereas y just throws an error because it has not been declared.