title: js memory organization - closures versus objects?
body: <p>When I develop in JS, I'm frequently faced with the choice between capturing variables with an inner function (closure) and using an object.</p>
  
  <p>Inner function:</p>
  
  <pre><code>var x = ...;
  var f = function() {
      // use x here
  }
  </code></pre>
  
  <p>Object:</p>
  
  <pre><code>obj.x = ...;
  obj.f = function() {
      // use x here
  }
  </code></pre>
  
  <p>The inner function approach "feels" more natural, but I was wondering - are there performance implications to worry about doing it one way or another, and what is the most idiomatic way to do this kind of thing?</p>