Search This Blog

2018/02/14

Remove duplicate value from array

function unique(list) {
  var result = [];
  $.each(list, function(i, e) {
    if ($.inArray(e, result) == -1) result.push(e);
  });
  return result;
}

No comments :

Post a Comment