javascript: array of variables or separate variables?
<p>I used to store variables separately, for example, if I have an old element I would save it in a variable called "ele_old", and then later if I have a new element I would save that in a variable called "ele_new". However, it just occurred to me that I can save the 2 variables in 1 array variable, so I could do something like this:</p>

<pre><code>eles_arr['old'] = //old element;
eles_arr['new'] = //new element;
</code></pre>

<p>this way would allow me to put variables of the same type into the same array for better organization, e.g. elements together in 1 array, and then ids together in another array.</p>

<p>The problem is I am quite new to javascript (and any other programming languages, for that matter), so I'm wondering if this is an inferior way than just keeping each variable separate. Will doing this cause any problems? for example, poor runtime performance?</p>

<p>Thanks!</p>
