×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Rodrigo (Digão) Ferreira
Added: Nov 14, 2013 7:44 PM
Views: 20
  1. var names = ["Mike","Matt","Nancy","Adam","Jenny","Nancy","Carl"];
  2. var uniqueNames = [];
  3. $.each(names, function(i, el){
  4.     if($.inArray(el, uniqueNames) === -1) uniqueNames.push(el);
  5. });