title: JavaScript: Adding to an associative array
body: <p>I have a function called insert which takes two parameters (<em>name</em> and <em>telnumber</em>).</p>
  <p>When I call this function I want to add to an associative array.</p>
  <p>So for example, when I do the following:</p>
  <pre><code>insert(&quot;John&quot;, &quot;999&quot;);
  insert(&quot;Adam&quot;, &quot;5433&quot;);
  </code></pre>
  <p>I want to it so be stored like this:</p>
  <pre><code>[0]
  {
  name: John, number: 999
  }
  [1]
  {
  name: Adam, number: 5433
  }
  </code></pre>