How to append to a JavaScript array dynamically?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2250953/how-do-i-create-javascript-arrayjson-format-dynamically">How do I create Javascript array(JSON format) dynamically?</a>  </p>
</blockquote>



<p>I am attempting to create the following:</p>

<pre><code>var employees = {"accounting": [   // accounting is an array in employees.
                    { "firstName" : "John",  // First element
                      "lastName"  : "Doe",
                      "age"       : 23 },

                    { "firstName" : "Mary",  // Second Element
                      "lastName"  : "Smith",
                      "age"       : 32 }
                  ] // End "accounting" array.                                  

    } // End Employees
</code></pre>

<p>I started out with:</p>

<pre><code> var employees=new Array();
</code></pre>

<p>How do I continue to append to the array dynamically (might change firstName with variable)?</p>
