Answers for "javascript get unique keys from list"

3

javascript get unique values from key

const unique = [...new Set(array.map(item => item.age))];
Posted by: Guest on June-05-2020
1

javascript get unique items of array

function toUniqueArray(a){
    var newArr = [];
    for (var i = 0; i < a.length; i++) {
        if (newArr.indexOf(a[i]) === -1) {
            newArr.push(a[i]);
        }
    }
  return newArr;
}
Posted by: Guest on July-23-2019

Code answers related to "javascript get unique keys from list"

Code answers related to "Javascript"

Browse Popular Code Answers by Language