Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery get unique values from array

var a = [ 1, 5, 1, 6, 4, 5, 2, 5, 4, 3, 1, 2, 6, 6, 3, 3, 2, 4 ];

var unique = a.filter(function(itm, i, a) {
    return i == a.indexOf(itm);
});

console.log(unique);
 Run code snippet
Comment

PREVIOUS NEXT
Code Example
Javascript :: move dom element to another parent 
Javascript :: string contains in javascript 
Javascript :: iffi in js 
Javascript :: How to fix CSS & JS not loading issue in cPanel laravel 
Javascript :: subtract two date javascript 
Javascript :: document.write multiple lines 
Javascript :: are you sure javascript 
Javascript :: moment in react native 
Javascript :: navigate-to-an-anchor-on-another-page 
Javascript :: firebase timestamp 
Javascript :: jest-environment-jsdom cannot be found 
Javascript :: how to make slide js in owl carousel auto 
Javascript :: add property to string js 
Javascript :: javascript remove last character in a string 
Javascript :: sleep function js 
Javascript :: check if body has class javascript 
Javascript :: console.log javascript 
Javascript :: vite install in vue 
Javascript :: clear session storage on refresh 
Javascript :: ciclo for javascript 
Javascript :: select add option js 
Javascript :: js delete all array items 
Javascript :: for loop infinite javascript 
Javascript :: can we find lenght of an object 
Javascript :: get all the properties of a object in javascript 
Javascript :: how to make required field in jquery false 
Javascript :: jquery click outside 
Javascript :: jquery checkbox 
Javascript :: chartjs stacked bar show total 
Javascript :: split date using javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =