LearnFrenzy
Sign in Take a free test

Scope and Hoisting · Scope and Hoisting MCQ · Question 4

What is hoisted completely? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 4 Back to Exercise

Which declaration is hoisted together with its value, so it can be fully used before its line?

  • A var calc = 1;
  • B let calc = 1;
  • C function calc() {} Correct
  • D class Calc {}
Correct Answer: Option C

Function declarations are created in full during the creation phase. var is hoisted as undefined; let and class are hoisted but uninitialised.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links