Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript find unique values in array of objects

var flags = [], output = [], l = array.length, i;
for( i=0; i<l; i++) {
    if( flags[array[i].age]) continue;
    flags[array[i].age] = true;
    output.push(array[i].age);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #find #unique #values #array #objects
ADD COMMENT
Topic
Name
5+4 =