title: Passing arguments to an IIFE
body: <p>What's the correct syntax for passing arguments to an IIFE stored in a variable?</p>
  
  <p>Example below tells me that <code>foo</code> is not defined, regardless on if I call the function or not:</p>
  
  <pre><code>var bar = (function(foo){
  
      return { 
          getFoo: function(){
              return foo;
          } 
      }
  
  })(foo);
  
  console.log(bar.getFoo(1));
  </code></pre>
  
  <p><a href="http://jsfiddle.net/eSTkL/">http://jsfiddle.net/eSTkL/</a></p>