Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #unique #values #array #javascript #duplicate
ADD COMMENT
Topic
Name
6+4 =