title: Need help for output
body: <p>Can anyone answer this?</p>
  
  <p>What will the code below output to the console and why?</p>
  
  <pre><code>(function(){    
    var a = b = 3;    
  })();
  console.log("a defined? " + (typeof a !== 'undefined'));    
  console.log("b defined? " + (typeof b !== 'undefined'));
  </code></pre>
  
  <p>What will the code below output to the console and why?</p>
  
  <pre><code>var myObject = { 
      foo: "bar",    
      func: function() {    
          var self = this;    
          console.log("outer func:  this.foo = " + this.foo);    
          console.log("outer func:  self.foo = " + self.foo);    
          (function() {    
              console.log("inner func:  this.foo = " + this.foo);   
              console.log("inner func:  self.foo = " + self.foo); 
          }());    
      }    
  };    
  myObject.func();
  </code></pre>