The example in this article describes the method of using JavaScript to determine whether there are duplicates in an array. Share it with everyone for your reference. The details are as follows:
Array.prototype.del = function(){ var a = {}, c = [], l = this.length; for (var i = 0; i < l; i++) { var b = this[i]; var d = (typeof b) + b; if (a[d] === undefined) { c.push(b); a[d] = 1; } } return c; }
I hope this article will be helpful to everyone’s JavaScript programming design.