What is javascript hoisting?
Answer / Prashant Kumar Srivastava
"JavaScript hoisting is a mechanism where variable and function declarations are moved to the top of their respective scopes during the compilation phase. This means that declared variables and functions are accessible before they are actually defined in your code.nFor example:n```javascriptnconsole.log(hello); // Output: undefinednvar hello = 'World';n``` In this example, the variable `hello` is hoisted to the top of its scope, so it appears as if the assignment happens before the call to `console.log()`, resulting in the output of `undefined`."n
| Is This Answer Correct ? | 0 Yes | 0 No |
Can we learn javascript without knowing java?
Why extending array is bad idea?
How can javascript codes be hidden from old browsers that don't support javascript?
What are the application of javascript?
What is a javascript code?
Why global variables are bad javascript?
What is the statement to enable strict mode in javascript quiz?
What is a boolean in javascript?
What are the types used in javascript?
What makes a relation a function?
How do I get javascript?
What is the Difference between HTML and DHTML