Javascript remove duplicate array items

Found on Stackoverflow – Use the spread operator and the Set constructor

const removeDuplicateValues = (itemArray) =>
{
    return [...new Set(itemArray)];
};

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set

 

Gareth
Buy Me A Coffee
back arrowBack to Index