
Even though we are trying to access the value of x before it is declared, it doesn't throw an error. Instead, it prints undefined. #JavaScriptHoisting
This is because the declaration var x is hoisted to the top of its scope. However, the initialization x = 5 is not hoisted.
English







