Quiz Question 1 of 5
In the context of JavaScript's hoisting mechanism, which of the following statements about the code snippet below is true?
"use strict";
console.log(foo); // Line 1
var foo = "Hello";
let bar = "World";
console.log(bar); // Line 2
console.log(foo); // Line 3
Choose the correct answer below:
-
A
Line 1 will log "Hello", Line 2 will log "World", Line 3 will log "Hello".
-
B
Line 1 will throw a ReferenceError, Line 2 will log "World", Line 3 will log "Hello".
-
C
Line 1 will throw a ReferenceError, Line 2 will log "undefined", Line 3 will log "Hello".
-
D
Line 1 will log "undefined", Line 2 will log "World", Line 3 will log "Hello".