AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
You dont know js hoisting8/30/2023 ![]() In the first example above, var hoisted would have been ‘hoisted’ to the top of scope within the hoist() function. Therefore any function or variable declared in a given scope will be available throughout that scope. This part actually occurs first, before the code is executed. Part of the compilation step is finding all the declarations (variables and functions) and associate them with the appropriate scope. As we mentioned in the previous article, JavaScript is a compiled language. ![]() The above snippet will log ‘Henry’ to the console.īoth of the above examples work because of hoisting.
0 Comments
Read More
Leave a Reply. |