Node.js examples for Array:Array Value
Treats arrays as set and adds the new elements
// Treats arrays as set and adds the new elements Array.prototype.addSet = function(values){ for(var i=0; i < values.length; i++){ if(this.indexOf(values[i]) == -1) this.push(values[i]); }/*from w w w.j av a 2 s .c o m*/ }