let vs var in the global scope : <p>Why this will print the names as expected:</p>

<pre><code>var firstName = 'Charlie',
    lastName  = "Brown"

function showFullName() {
    console.log(this.firstName+' '+this.lastName);
}

window.showFullName();
</code></pre>

<p>but, if I replace 'var' for 'let', I will get 'undefined' for both firstName &amp; lastName?</p>

<p>I also see that the variables declared using 'var' get attached to the window Object, but the ones declare using 'let'.</p>

<p>Appreciate the help. </p>
