Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

Which statement about hoisting is correct?

  1. A var declarations are hoisted and initialised to undefined; let and const are hoisted but uninitialised
  2. B Nothing is hoisted in modern JavaScript
  3. C Only function expressions are hoisted
  4. D let is initialised to null when hoisted
Answer

var declarations are hoisted and initialised to undefined; let and const are hoisted but uninitialised

This difference is why reading a var before its declaration gives undefined while reading a let throws a ReferenceError.

All Javascript MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as