Frage im Vorstellungsgespräch bei Dev Story

Explain the concept of "hoisting" in JavaScript.

Antwort im Vorstellungsgespräch

Anonym

10. Dez. 2024

Hoisting is the behavior where variable and function declarations are moved to the top of their containing scope during compilation. console.log(x); // undefined var x = 5; // Function hoisting greet(); function greet() { console.log("Hello!"); }