JavaScript Block scope in JavaScript Question #20277
Single Choice Easy

QWhat will be the output of the following JavaScript code?

let a = 12;
{
    let a = 15;
    console.log(a);
}

ID: #20277 Block scope in JavaScript 104 views
Question Info
#20277Q ID
EasyDifficulty
Block scope in JavaScriptTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 10
  • B 15
  • C Undefined
  • D Error
Correct Answer

Explanation


15

Share This Question

Challenge a friend or share with your study group.