Answers for "jquery remove duplicates from array"

0

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;
}
Posted by: Guest on March-17-2022

Code answers related to "jquery remove duplicates from array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language