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 does hoisting in JavaScript refer to?

View

Which of the following is true about function declarations?

View

What is the result of this code? console.log(foo()); function foo() { return "Hello"; }

View

What happens when a function expression is invoked before it is declared?

View

What does function hoisting allow you to do?

View

What happens to variables declared with var in terms of hoisting?

View

Which of the following is not hoisted?

View

What will the following code output? var greet = function() { return "Hi"; }; console.log(greet());

View

What does function hoisting apply to?

View

Which statement is true regarding function hoisting?

View

What does hoisting in JavaScript refer to?

Automatic assignment of variables
Declaring functions without function keyword
Moving declarations to the top of their scope
Pre-executing code before the runtime

Which of the following is true about function declarations?

They are hoisted to the top of their scope
They are always executed before variable declarations
They must be declared before being used
They behave the same as function expressions

What is the result of this code? console.log(foo()); function foo() { return "Hello"; }

Hello
undefined
Error
null

What happens when a function expression is invoked before it is declared?

It throws a TypeError
It works just like a function declaration
It returns undefined
It throws a ReferenceError

What does function hoisting allow you to do?

Call functions before declaring them
Create anonymous functions
Avoid function definitions
Modify the 'this' context

What happens to variables declared with var in terms of hoisting?

They are hoisted but initialized with undefined
They are hoisted and initialized
They are not hoisted
They are only hoisted in strict mode

Which of the following is not hoisted?

Function declarations
Function expressions
var variables
let variables

What will the following code output? var greet = function() { return "Hi"; }; console.log(greet());

Hi
undefined
Error
null

What does function hoisting apply to?

Function declarations
Function expressions
Arrow functions
Both declarations and expressions

Which statement is true regarding function hoisting?

Function declarations are fully hoisted
Function expressions are hoisted with their definition
Variables declared with const are hoisted
Only anonymous functions are hoisted