Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

jquery remove duplicates from array

//The jQuery unique method only works on an array of DOM elements.
//You can easily make your own uniqe function using the each and inArray methods:
function unique(list) {
  var result = [];
  $.each(list, function(i, e) {
    if ($.inArray(e, result) == -1) result.push(e);
  });
  return result;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #jquery #remove #duplicates #array
ADD COMMENT
Topic
Name
4+9 =