Node.js examples for Array:Set Operation
Deep unique array element
Array.prototype.deepUnique = function () { var a = {};/*ww w. java2s.c o m*/ for (var i = 0, l = this.length; i < l; i++) { var hash = JSON.stringify(this[i]); if (a[hash] === undefined) { a[hash] = this[i]; } } return Object.values(a); }