because before the javascript engine starts executing your code it sets up a memory space of all the variables in your code as "undefined", thats hoisting.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Why did the variable logged as undefined?
because before the javascript engine starts executing your code it sets up a memory space of all the variables in your code as "undefined", thats hoisting.