Search
 
SCRIPT & CODE EXAMPLE
 

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;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: global error handling middleware express 
Javascript :: timestamp to date javascript 
Javascript :: jquery check if clicked outside div 
Javascript :: cra redux 
Javascript :: uploadgetfiletypefileextension 
Javascript :: add bootstrap to angular 13 
Javascript :: discord js on message 
Javascript :: read and update csv file in nodejs 
Javascript :: react to string 
Javascript :: nginx redirect location to port 
Javascript :: button in vanilla js 
Javascript :: prevent a page from refreshing in react 
Javascript :: how to auto refresh a div js 
Javascript :: drupal 8 check if current page is node 
Javascript :: ERESOLVE unable to resolve dependency tree Found: react@17.0.2 Could not resolve dependency: react native paper 
Javascript :: Remove duplicate items form array using reduce() method. 
Javascript :: javascript console group 
Javascript :: jquery selector this and class 
Javascript :: js write and get cookie 
Javascript :: get html input value by class name 
Javascript :: jquery unfocus 
Javascript :: metamask event disconnect 
Javascript :: mat checkbox change event in angular 7 
Javascript :: replace element from string javascript 
Javascript :: Extract phone number from text regex 
Javascript :: hide and show on button click in react js functional component 
Javascript :: first and last char vowel reg exp same char 
Javascript :: javascript sort array by object property 
Javascript :: get $_get in javascript 
Javascript :: remove duplicates from array 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =