Setting javascript defineGetter and defineSetter in a loop
<p>Why does each iteration of this:</p>

<pre><code>var o = {};

var foo = [['a',1],['b',2],['c',3],['d',4],['e',5]];

for(var i = 0; i &lt; 5; i++)
{
  o.__defineGetter__(foo[i][0], function() {
    return foo[i][1]; 
  });
  console.info(JSON.stringify(o));
}
</code></pre>

<p>Reset all previous assignments and output this:</p>

<pre><code>{"a":1}
{"a":2,"b":2}
{"a":3,"b":3,"c":3}
{"a":4,"b":4,"c":4,"d":4}
{"a":5,"b":5,"c":5,"d":5,"e":5}
</code></pre>

<p>When what I expect / want to finish with is:</p>

<pre><code>{"a":"1","b":"2","c":"3","d":"4","e":"5"}
</code></pre>

<p>How do I achieve what I want?</p>
