How to avoid having undefined members in an array in JavaScript?
<p>The problem is strange: I removed from Array (association) a few elements by splice function,  after this I added a few elements and suddenly there were "underfined" elements. Below there is the log (after '//' this my comment to this):</p>

<pre><code>// adding first element; array length = 1
["asdasdasd"] microblog.js:48

// adding second element; array length = 2
["asdasdasd", "asdasdasd"] microblog.js:48 

// adding third element;  array length = 3
["asdasdasd", "asdasdasd", "asdasdasdqwe"] microblog.js:48 

// removing second element;  array length = 2
["asdasdasd", "asdasdasdqwe"] microblog.js:66 

// removing third element; array length = 1
["asdasdasdqwe"] microblog.js:66

// adding new element;  array length = 4
["asdasdasdqwe", undefined × 2, "asdasdqwrevcvxzvvxwfrqeqwewq"] 
</code></pre>

<p>And this is how I add an element:</p>

<pre><code>(...)
this.list[currId] = text;
(...)
</code></pre>

<p>And this is how I remove an element </p>

<pre><code>(...)
this.list.splice(currId, 1);
(...)
</code></pre>

<p>How to avoid this undefined elements?</p>
