Hi,
I suggest to combine 2 in 1:
I.e.:
Array.prototype.pushUnique = function (item) { var push = true; for (var k = 0; k < this.length; k++) if (this[k] == item) {push = false; break} if (push) this.push(item); }
myArray.pushUnique(value);
... or the same with a 'function' way. As far as I know the difference is prototype RAM consuming (if many objects present) but that's only what I read about somewhere..., can't prove it
Jarek