Using a variable as an array parameter in javascript?
<p>I want to use a variable as the index parameter in an array but for some reason it's coming up as "undefined" when I do it this way. Any ideas?</p>

<pre><code>var object_number = [];
var x = 1;

    function create_new_object()
    {
        object_number[x] = new happy_object();
        x++;

    }
</code></pre>
