Using myFuncArray.shift()() to call functions
<p>I am having troubles using shift() to call functions I have put in an array. I have put together a simple example illustrating the problem.</p>

<p>Essentially the function gets called, however, the changes to variables in the function do not stick.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript"&gt;
Taco = function() {};
Taco.prototype.init = function() {
  this.ex1 = "ex1 in init()";
  alert(this.ex1);
};
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;input type="Submit" onClick="withShift();" value="withShift"/&gt;
&lt;div id="div1"&gt;
&lt;/div&gt;
&lt;input type="Submit" onClick="noShift();" value="noShift"/&gt;
&lt;div id="div2"&gt;
&lt;/div&gt;
&lt;script type="text/javascript"&gt;
// This calls init but does not hold the value of ex1 after the call
withShift = function() {
taco = new Taco();
  funcQ = [];
  funcQ.push(taco.init);
  funcQ.shift()(); 

  div1 = document.getElementById("div1")
  div1.appendChild(document.createTextNode(taco.ex1));
};

// this calls init and it holds the value...
noShift = function() {
  taco2 = new Taco();
  taco2.init();
  div1 = document.getElementById("div2")
  div1.appendChild(document.createTextNode(taco2.ex1));
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Thank you in advance for any suggestions.</p>
