JavaScript Variable Hoisting Interview question, var initialised with undefined

Published: 25 September 2021
on channel: JavaScript Shorts
314
4

JavaScript Variable Hoisting Interview question with var initialised as undefined initially

Output: true

Explanation:
During the creation phase variable x initialised with var keyword is hoisted to the top and its value is set undefined
During the execution phase when the console statement is executed value of x is undefined and true is printed in console
Then var x is set to value 2

#interview_questions


On this page of the site you can watch the video online JavaScript Variable Hoisting Interview question, var initialised with undefined with a duration of hours minute second in good quality, which was uploaded by the user JavaScript Shorts 25 September 2021, share the link with friends and acquaintances, this video has already been watched 314 times on youtube and it was liked by 4 viewers. Enjoy your viewing!