Trying to access a property of an undefined variable throws a TypeError. For example, if you have let x; and then try to access x.property, JavaScript will throw: 'TypeError: Cannot read properties of undefined (reading 'property')'. This occurs because undefined is a primitive value, not an object, and therefore doesn't have properties. A ReferenceError would occur if you tried to access a variable that hasn't been declared at all (e.g., console.log(y) without declaring y).