because let is block scoped, that variable declared with let exists only inside the code block, if you put the console log outside the if statement, the aNumber variable will have value of 5
I already know that the let statement creates the variable locally but is block scoped, like this:
var aNumber = 5;
// I am defining the aNumber variable, with its value of 5.
if (aNumber === 5) {
// this test is true.
let aNumber = 10; // aNumber is already set to 10.
console.log(aNumber); // 10
}