Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

removing duplicates from array javascript

var names = ["Mike","Matt","Nancy","Adam","Jenny","Nancy","Carl"];
var uniqueNames = [];
$.each(names, function(i, el){
    if($.inArray(el, uniqueNames) === -1) uniqueNames.push(el);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #removing #duplicates #array #javascript
ADD COMMENT
Topic
Name
7+7 =