title: Remove Duplicates description: Removes duplicate values from an array. author: dostonnabotov tags: array,deduplicate

const removeDuplicates = (arr) => [...new Set(arr)];

// Usage:
const numbers = [1, 2, 2, 3, 4, 4, 5];
removeDuplicates(numbers); // Returns: [1, 2, 3, 4, 5]
  • LinuxerOPM
    link
    fedilink
    English
    arrow-up
    1
    ·
    19 days ago

    Hey Here’s what I am working on ,