Skip to content
David Turner edited this page May 26, 2015 · 3 revisions

(1) Why does the following code print null and not 6 or 10?

var i = 6;
function f() {
  console.log(i);
  var i = 10;
}
f();

Clone this wiki locally