Why is
for (var i in window) { console.log(i); }
interpreted differently from
for (var i in window) { console.log(window[i