Single Choice Easy

QWhat will be the output of the following JavaScript code?

var a = 12;
const a = 12;
{
    const a = 22;
    console.log(a);
}
 

ID: #20280 Block scope in JavaScript 90 views
Question Info
#20280Q ID
EasyDifficulty
Block scope in JavaScriptTopic

Choose the Best Option

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

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

Explanation


22

Share This Question

Challenge a friend or share with your study group.