function array and strange behaviour
<p>I have the following code:</p>

<pre><code>var arr = [{Name: "foo", action: function(){ alert("foo")}},
       {Name: "bar", action: function(){ alert("bar")}}
      ]

var arr2 = {};

for(var i =0; i&lt; arr.length; i++)
{
    var bla = arr[i];
    arr2[bla.Name] = function(){ bla.action() };
}          

arr2.foo();
arr2.bar();
</code></pre>

<p>that alerts two times "bar".
when instead I do </p>

<pre><code>    arr2[bla.Name] = bla.action;
</code></pre>

<p>that works.</p>

<p>any way to make it works in the first case (I need to append other things in my function)</p>

<p>Thanks !</p>
