Function Scope

Inside a function all variables declared with var, let or const have Function Scope:

Uncaught ReferenceError: x is not defined

Uncaught ReferenceError: y is not defined

Uncaught ReferenceError: z is not defined