title: Remove an element from array with user input
body: <p>I'm having an issue with removing items from a Javascript array. I am using a prompt, and when the user inputs a worker's ID number, I want that element to be removed from the array.</p>
  
  <p>At the moment, my code will only remove the final element in the list. </p>
  
  <p>This is my code:</p>
  
  <pre><code>var remove = function(){
      var removeID = prompt("Enter ID of the worker you wish to remove: ");
      var index = array.indexOf(removeID);
      if(removeID == id){
          array.splice(index, 1);
          showArray();
      }
      else{
          alert("id is not in the system");
      }
  }
  </code></pre>