Tweetovi

Blokirali ste korisnika/cu @JSitorEditor

Jeste li sigurni da želite vidjeti te tweetove? Time nećete deblokirati korisnika/cu @JSitorEditor

  1. Prikvačeni tweet
    Prikaži ovu nit
    Poništi
  2. 29. sij
    Odgovor korisnicima

    It is 10 because the function f is assigning b to 10. So the function inside f is actually let a = (b = 10). Since b is not declared in the function scope it re assigns the b value outside of f.

    Poništi
  3. Poništi
  4. 28. sij
    Poništi
  5. Poništi
  6. Poništi
  7. Poništi
  8. The correct answer is “undefined”, because var has function level scope and not block level scope. Thats why, var i is still hoisted on top the function, causing it to print undefined

    Prikaži ovu nit
    Poništi
  9. The correct answer is Reference Error. The declaration of let does not hoist, however if we try to use the same name variable declared later in the block scope will look into the current scope only and not on parent scope.

    Prikaži ovu nit
    Poništi
  10. 🚀JavaScript Quiz 🚀 const i = 10 function f(){ console.log(i) // ❔🧐 if(1){ var i = 20 } } f()

    Prikaži ovu nit
    Poništi
  11. 🚀JavaScript Quiz 🚀 const i = 10 function f(){ console.log(i) // ❔🧐 if(1){ var i = 20 } } f()

    Prikaži ovu nit
    Poništi
  12. 24. sij

    When your little quiz app gets featured in JavaScript Weekly 😶

    Poništi
  13. Prikaži ovu nit
    Poništi
  14. 24. sij
    Poništi
  15. 24. sij
    Odgovor korisniku/ci

    This is I say NeVar!!!

    Poništi
  16. 24. sij
    Odgovor korisniku/ci

    This is why people say “I think I’ll just be a backend developer” and start coding in python 😂😂😂

    Poništi
  17. Odgovor korisnicima

    let needs to be declared before console log(i); otherwise returns an error due to the console.log not being able to hoist to the global variable i=10; ;;;;;;;;;;;

    Poništi
  18. 24. sij
    Odgovor korisniku/ci
    Poništi
  19. 24. sij
    Odgovor korisnicima

    Yes, you are correct. Thanks for showing me my error.

    Poništi
  20. 24. sij
    Odgovor korisnicima

    the correct answer, wrong explanation. "i" has not been defined yet in the lexical scope of foo(), that's why undefined. Please correct if I'm wrong.

    Poništi
  21. 24. sij
    Odgovor korisnicima

    var is a global and function scope. But let is a block scope. The important thing let can' t hoisted. For that reason ReferenceError, cause function can not access 'i' before initialization.

    Poništi

Čini se da učitavanje traje već neko vrijeme.

Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.

    Možda bi vam se svidjelo i ovo:

    ·