title: Push Functions into an Array - Loop through and Splice?
body: <p>Using Javascript i need to be able to:</p>
  
  <p>1: Push a certain amount of the same function (with a different parameter in each) into an array.</p>
  
  <p>2: Then run each function one by one (for this example just an alert of the parameter/number)</p>
  
  <p>3: After each function i need to be able to SPLICE that function out of the array</p>
  
  <p>4: Check the Array Length after everytime - Once the array is empty again - alert the user it is complete</p>
  
  <p>Now i seem to be able to do task 1,2 and 4 but i am sturggling with how to splice out the function from the array after it has run - can anyone help? As i cannot remove the function i am never getting the 'done' alert once all functions have been called</p>
  
  <p>My javascript code so far is:</p>
  
  <pre><code>// Create empty array
  var array = [];
  
  // Push functions into array - dynamic amount and could be any amount of functions
  array.push(func(1));
  array.push(func(2));
  array.push(func(3));
  
  // Call array manager function after pushing array
  arrayManager();
  
  // Array manager function to splice and detect when finished
  function arrayManager() {
      if (array.length &lt; 1) {
          alert("done");
      }
      else {
      //////////////////////////////////
      // &lt;&lt; THIS IS WHERE I DON'T KNOW HOW TO SPLICE THE ITEM FROM THE ARRAY
      //////////////////////////////////
      }
  }
  
  // Function for array objects - alert passed parameter
  function func(num){
      alert(num);
  }
  </code></pre>