Populating an array of objects in javascript
<p>Let us say I have an object Airport with members airportCode and airportCity like this: </p>

<pre><code>function Airport(airportCode, airportCity) {
        this.airportCode = airportCode;
        this.airportCity = airportCity;
    };     
</code></pre>

<p>How can I create an array of objects Airport to which I can add. In Java, this would work like this: </p>

<pre><code>while(st.hasMoreTokens()) {
    Airport a = new Airport();
    a.airportCode = st.nextToken();
    a.airportCity = st.nextToken();
    airports.add(a);
}
</code></pre>
