“Not defined and Undefined” in JS are not the same thing. Let’s discuss what they actually means.
Not defined: It occurs when you consoled the variable without defining it. Moving deep down, To be consoled it must be in the memory space right ! so, without defining any variable, how would it supposed to take the memory space. So, this will cause the error ‘not defined’.