Master Core JavaScript Fundamentals

This quiz emphasizes key JavaScript concepts, including Variable Hoisting and Scoping, Template Literals, and Arrow Functions. You’ll delve into how variables behave with var, let, and const, use string interpolation with template literals, and explore the behavior of this in arrow functions. Strengthen your fundamentals with these essential topics!

Question 1.

What will the following output?

  • A.

    undefined

  • B.

    5

  • C.

    ReferenceError

  • D.

    ReferenceError

Question 2.

What will this code produce?

  • A.

    undefined

  • B.

    10

  • C.

    ReferenceError

  • D.

    TypeError

Question 3.

What will happen here?

  • A.

    10

  • B.

    7

  • C.

    TypeError

  • D.

    undefined

Question 4.

Which is a correct use of template literals?

  • A.

    "Hello, " + name

  • B.

    `Hello, ${name}`

  • C.

    "Hello, ${name}"

  • D.

    `Hello, " + name`

Question 5.

What will this output?

  • A.

    The result is 53

  • B.

    The result is 5 + 3

  • C.

    The result is 8

  • D.

    The result is undefined

Question 6.

What does the following return?

  • A.

    undefined

  • B.

    window

  • C.

    null

  • D.

    ReferenceError

Question 7.

Which statement about arrow functions is true?

  • A.

    They have their own this

  • B.

    They inherit this from their surrounding scope

  • C.

    They require curly braces

  • D.

    They cannot take arguments

Question 8.

What will this code log?

  • A.

    Hello, undefined

  • B.

    Hello, John

  • C.

    Hello,

  • D.

    ReferenceError

Question 9.

What does this return?

  • A.

    Hi, undefined

  • B.

    Hi, Jane

  • C.

    ReferenceError

  • D.

    TypeError

Question 10.

What will happen if we redeclare a let variable?

  • A.

    25

  • B.

    undefined

  • C.

    ReferenceError

  • D.

    SyntaxError