Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get unique values from array in javascript without duplicate value

function uniqueArray2(arr) {
    var a = [];
    for (var i=0, l=arr.length; i<l; i++)
        if (a.indexOf(arr[i]) === -1 && arr[i] !== '')
            a.push(arr[i]);
    return a;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: authfunctions express 
Javascript :: javascript array reorder elements 
Javascript :: javascript is not null 
Javascript :: javascript howdo i redirect-to another webpage 
Javascript :: regexp constructor js 
Javascript :: createelement with id javascript 
Javascript :: javascript colab connect 
Javascript :: jquery get value of input submit 
Javascript :: generate random id 
Javascript :: how to get the timestamp in javascript 
Javascript :: append a query string to the url react 
Javascript :: upload multiple files axios 
Javascript :: nodejs fs root folder path 
Javascript :: how to remove an element javascript html 
Javascript :: javascript input prompt example 
Javascript :: dynamic folder import javascript 
Javascript :: localstorage clear item 
Javascript :: js loop array in array 
Javascript :: js pass object property as a function parameter 
Javascript :: ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @agm/core@1.1.0 npm ERR! Found: @angular/common@10.0.14 
Javascript :: javascript for...of loop to iterate over the multidimensional array 
Javascript :: js foreach 
Javascript :: discord.js bot mention 
Javascript :: js sleep 
Javascript :: nuxt progress false 
Javascript :: javascript localstorage 
Javascript :: gsap pin scrolltrigger 
Javascript :: angular findindex object based array 
Javascript :: loop through javascript object 
Javascript :: open bootstrap modal with javascript 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =