title: How to add and remove elements of an Array
body: <p>I want to maintain a list of things in javascript. This seems to be a non trivial problem in this language...</p>
  
  <pre><code>var things = []
  
  // for adding:
  things[things.length] = thing
  
  // for removing:
  delete (things[things.indexOf(thing)])
  </code></pre>
  
  <p>This kinda works, but I fear the adding is a bug. When a thing that is not at the end of the array gets removed, a following add operation will overwrite an existing element, right? Because length is the number of elements.</p>
  
  <p>How to do the adding correctly? Or is there a better way to do this with plain javascript (no JQuery)?</p>