FrontendInterviews.dev

664. IIFE var Shadowing with this.a

Easy•

Predict the output.

var a = 1;
(function() {
  console.log(a + this.a);
  var a = '2'
  console.log(a + this.a);
})();

What is printed in order?

Select an option and submit your answer.
Next Problem