BrazilJS

Share this post
Zero Dev S01E02: Hoisting na prática
www.braziljs.org

Zero Dev S01E02: Hoisting na prática

BrazilJS
Mar 26, 2019
Comment
Share

Bora botar a mão na massa? Vamos ver o hoisting ao vivo, literalmente, passo-a-passo.

1)

    function fofoca (idade=0) {       if (idade > 18) {         var nome = "Felipe";         console.log(`Uma fofoca sobre ${nome}`);       } else {         console.log("Não posso opinar");       }     } 

2)

    function fofoca (idade=0) {       debugger;       if (idade > 18) {         var nome = "Felipe";         console.log(`Uma fofoca sobre ${nome}`);       } else {         console.log("Não posso opinar");       }     } 

3)

    console.log(qualÉMeuNome()); function qualÉMeuNome () {       return "Felipe";     };  4)     debugger;     console.log(qualÉMeuNome()); function qualÉMeuNome () {       return "Felipe";     }; 
CommentComment
ShareShare

Create your profile

0 subscriptions will be displayed on your profile (edit)

Skip for now

Only paid subscribers can comment on this post

Already a paid subscriber? Sign in

Check your email

For your security, we need to re-authenticate you.

Click the link we sent to , or click here to sign in.

TopNewCommunity

No posts

Ready for more?

© 2022 BrazilJS
Privacy ∙ Terms ∙ Collection notice
Publish on Substack Get the app
Substack is the home for great writing