title: How do I store javascript functions in a queue for them to be executed eventually
body: <p>I have created a Queue class in javascript and I would like to store functions as data in a queue. That way I can build up requests (function calls) and respond to them when I need to (actually executing the function).</p>
  
  <p>Is there any way to store a function as data, somewhat similar to</p>
  
  <pre><code>.setTimeout("doSomething()", 1000);
  </code></pre>
  
  <p>except it would be</p>
  
  <pre><code>functionQueue.enqueue(doSomething());
  </code></pre>
  
  <p>Where it would store doSomething() as data so when I retrieve the data from the queue, the function would be executed.</p>
  
  <p>I'm guessing I would have to have doSomething() in quotes -> "doSomething()" and some how make it call the function using a string, anyone know how that could be done?</p>