I want my code give me "2" as a output but this shows me "1" as an output. Please tell me what changes must I do in my code so that it give me a correct result.
var a = 1;
function x() {
  var a = 2;
  function b() {
    var self = this;
    console.log(self.a);
  }
  b();
}
x();
 
     
     
     
     
    