var nav = document.querySelector('.nav'); // <nav class="nav">
var toggleNav = function () {
console.log(this); // <nav> element
setTimeout(function () {
console.log(this); // [object Window]
}, 1000);
};
In the example code above, why is this in line 3 the element when the variable nav is declared outside of the scope of toggleNav? Thanks