Skip to content

Commit b5b3428

Browse files
authored
Update js codes.docx
1 parent 7d6f778 commit b5b3428

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

js codes.docx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,6 +1843,10 @@ Hoisting:
18431843
until they are assigned because they are in Temporal dead zone.To avoid Temporal deadzone we need to declare let and const to the top of our program!
18441844
***when const gets hoisted it will be defined undefined,and further processing will get assigned the value , this violated the meaning of const , this is the fundamental reason why const doesn't get hoisted and let just got tagged along with this feature.
18451845

1846+
-- Can able to access variable and function before initialise. Can able to access it without any error.
1847+
-- console.log(getName); without parenthisis -- print the body of function.
1848+
1849+
18461850
Examples:
18471851
1. Hoisting Function: If i write below code then JS compiler auto move declaration first then call of a function.
18481852
hello() //call

0 commit comments

Comments
 (0)