In JavaScript, when using the var keyword to declare a variable, the JS engine assigns a default value of "undefined" at creation stage.
console.log(message); // undefined
var message = "My message";
However, with the let keyword:
console.log(message); // message is not defined
let message = "My message";
Why does this result in an unexpected outcome? Could it be due to changes in ES6?