β Before going deep dive into this topic there is a prerequisite for this topic which is "scope" in javascript.
π You can learn it from hereπ
π You can learn it from hereπ
π What is HOISTING?
β HOISTING is a JavaScript behavior in which a function or variable can be accessed or used before the declaration.
β Or, a JavaScript variable/function can be used before being declared.
β HOISTING is a JavaScript behavior in which a function or variable can be accessed or used before the declaration.
β Or, a JavaScript variable/function can be used before being declared.
β But it is not going to work with let and const keywords.
β Hoisting only works with the "var" keyword.
β Javascript "initialization" is not hoisted but "declarations" are hoisted.
β Hoisting only works with the "var" keyword.
β Javascript "initialization" is not hoisted but "declarations" are hoisted.
β The above image shows that the red box is in the "temporal dead zone" of the "TDZ" variable.
β That means it can be accessible before line number 6.
β It will be accessible starting from the line where it is defined.
β Otherwise, we will get a ReferenceError.
β That means it can be accessible before line number 6.
β It will be accessible starting from the line where it is defined.
β Otherwise, we will get a ReferenceError.
That's all for now, we will meet in the next threadπ
But if you like make sure to:
1. Follow me @ATechAjay
2. Retweet the first tweet.
3. Turn on the notification to never miss these amazing tweets.
Thank you so much for staying to the end of this thread.
But if you like make sure to:
1. Follow me @ATechAjay
2. Retweet the first tweet.
3. Turn on the notification to never miss these amazing tweets.
Thank you so much for staying to the end of this thread.
Loading suggestions...