Quiz Question 1 of 5
Analyze the following code and determine what will happen:
"use strict";
function outerFunction() {
let outerVar = 10;
function innerFunction() {
var innerVar = 20;
outerVar = outerVar + innerVar;
}
innerFunction();
return outerVar;
}
alert(outerFunction());
alert(innerVar);
Choose the correct answer below:
-
A
The first alert will show 10, and the second alert will show 20.
-
B
The first alert will show 30, and the second alert will show 20.
-
C
The first alert will throw a ReferenceError, and the second alert will not execute.
-
D
The first alert will show 30, and the second alert will throw a ReferenceError.