If you have any query feel free to chat us!
Happy Coding! Happy Learning!
Function hoisting is a JavaScript mechanism where function declarations are moved to the top of their scope before code execution. This means that functions can be called before they are declared in the code.
For example:
scssCopy code
foo(); // Output: "Hello world!" function foo() { console.log("Hello world!"); }
In the above code snippet, the foo
function is called before it is declared. However, since function declarations are hoisted to the top of their scope, the function is executed successfully and the output is "Hello world!".
It's important to note that function hoisting only applies to function declarations, not function expressions. Function expressions are not hoisted and will result in a ReferenceError
if they are called before they are declared.
Comments: 2
I am not able to access videos from second class and further. I have already completed first class
When will I get my course?
Now, Your query was resolved.