Here's a useful snippet I've written in the past.
Array.prototype.empty = function() {
for (var i = 0, s = this.length; i < s; i++) { this.pop(); }
return this;
};
Array.prototype.removeAll = function(item) {
var result = [];
for (var i = 0, j = 0, s = this.length; i < s; i++) {
if (this[i] != item) { result[j++] = this[i]; }
}
this.empty();
for (var i = 0, s = result.length; i < s;) { this.push(result[i++]); }
};
Sure it may not be the best solution in the world, but it works, plus with this function you can always use it to remove other chars/specific elements from an array. Personally, I also prefer the syntax of using this, but that's just me, I personally think it's neater to write something like:
arrayVar.removeAll("");
Rather than something more like:
arrayVar = clean(ArrayVar);
All I know is that this solution works.