What's wrong with my remove function?
<pre><code>Array.prototype.remove = function (obj) {
    for(var i = 0; i &lt; this.length; i++) {
        if(this[i] === obj) {
            if (i == this.length) {
                this[i] = null;
            } else {
                for(var j = i; j &lt; this.length-1; j++) {
                    this[j] = this[j+1];
                }
                delete this[j]; // updated from this[j] = null; still not working.
            }
        }
    }
    return this;
};
</code></pre>

<p>calling it with:</p>

<pre><code>write("ARRAY TEST = " + [22, 33, 44].remove(33).remove(22));
</code></pre>

<p>..it prints:</p>

<pre><code>44,,
</code></pre>

<p>Why this 2 commas and how to fix my remove function to remove the commas as well?</p>
