8/23/2023 0 Comments You dont know js hoisting![]() Javascript assigns undefined to all declaration using the var keyword. Variables in Javascript are hoisted to the top of the current scope, (top of the function if declared inside a function or top of the file if declared outside any function i.e in the global scope or to the top of the block if declared using let/const). ![]() So let’s understand what Javascript hoisting really is. Have you ever tried to print the value of a variable that you hadn’t declared even, but instead of an error you got undefined? Well, that may be because of Javascript hoisting.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |