SyntaxFix
Write A Post
Hire A Developer
Questions
You can try this:
var names = ["Mike","Matt","Nancy","Adam","Jenny","Nancy","Carl"]; var uniqueNames = []; $.each(names, function(i, el){ if($.inArray(el, uniqueNames) === -1) uniqueNames.push(el); });
Easiest way to find duplicate values in a JavaScript array