Instructions

  • 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
  • 2. Thoroughly review each solution before proceeding to ensure full understanding.
  • 3. Final results will be available after submission to provide insights into areas for further improvement.
  • 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
  • 5. Once submitted, responses are final, so ensure you’re confident in your answers.
  • 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.

All Problems

Question

Action

What is hoisting in JavaScript?

View

Which of the following is true about variable hoisting?

View

What will the following code output?

View

Which of the following is NOT hoisted in JavaScript?

View

What is the output of the following code?

View

What will the following code output?

View

Which of the following is true about function hoisting?

View

What is the temporal dead zone (TDZ) in JavaScript?

View

What will the following code output?

View

Which of the following is true for hoisting with const declarations?

View

What is hoisting in JavaScript?

Moving variable and function declarations to the top of their scope
Moving all function expressions to the global scope
Making variables and functions available after execution
Moving the entire block of code to the top of the script

Which of the following is true about variable hoisting?

Both the declaration and initialization are hoisted
Only the declaration is hoisted, not the initialization
Neither the declaration nor the initialization is hoisted
Only the initialization is hoisted

What will the following code output?

<p>console.log(x);<br>var x = 10;<br><br></p>

10
undefined
Error
null

Which of the following is NOT hoisted in JavaScript?

Function declarations
Variable declarations (using var)
Function expressions
Class declarations

What is the output of the following code?

<p>console.log(func());<br>function func() {<br>&nbsp; return 'Hello!';<br>}<br><br></p>

'Hello!'
undefined
Error
null

What will the following code output?

<p>console.log(y);<br>let y = 20;<br><br></p>

20
undefined
ReferenceError
null

Which of the following is true about function hoisting?

Function expressions are hoisted but not initialized
Only named function declarations are hoisted
Both function declarations and expressions are hoisted
Only function declarations are hoisted

What is the temporal dead zone (TDZ) in JavaScript?

The period between variable declaration and initialization when accessing the variable will result in an error
The scope where variables are inaccessible due to scope chaining
A JavaScript error thrown for undefined variables
The area where global variables are stored

What will the following code output?

<p>console.log(a);<br>var a = 5;<br>console.log(b);<br>let b = 10;<br><br></p>

undefined, 10
undefined, ReferenceError
5, undefined
5, ReferenceError

Which of the following is true for hoisting with const declarations?

const declarations are hoisted and initialized with undefined
const declarations are hoisted but not initialized
const declarations are not hoisted at all
const declarations are fully initialized before execution