See the below image, especially the error message inside the red box.
let checkVar = () => {
alert(myName); // variable myName is not defined anywhere. Therefore it will throw an error.
}
Don't confuse this error with the undefined error. Both are different and have different meanings.
In the above example, I have not declared (or defined) the variable myName anywhere in my JS code. It does not know if it’s a string, number or a Boolean. As a result, it throws the error when I am trying to "alert" the variable, expecting to see the value strored in the variable.