When I put console.logfor any variable in the browser console that is not declared, it will return Uncaught ReferenceError: the variable is undefined . But when I put console.log(name)in the browser console, it returns empty and undefined. See image below. any ideas why this is happening.

I tested it in Chrome and Firefox developer tools.
Note. I use clear () to clear the console
vijay source
share