title: Delete entries from an associative array (JavaScript)
body: <p>I currently have a problem in deleting entries from an associative array in JS.</p>
  
  <p>I tried this:</p>
  
  <pre><code>  myArray['key'] = value;
    myArray['key1'] = value1;
  
    ...
  
    delete myArray['key'];
  </code></pre>
  
  <p>But I get following results in my application:</p>
  
  <pre><code>  [ undefined, { key1: 'value1', key2: 'value2' }, undefined,
      { key1: 'value1', key2: 'value2' }, undefined, undefined ]
  </code></pre>
  
  <p>How can I delete the whole entry, key and value? I found the method <strong>splice()</strong> but I think it uses a different index. I wasn't able to delete the entries I want by passing the key to splice().</p>