Home | Mailing List | Blog | Tutorial Videos

Global Local

Consider the following code block. What gets logged?

var x = 5;

(function() {
  console.log(x);
  var x = 10;
  console.log(x);
})();

Select one: