Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 299 Bytes

remove-duplicates.md

File metadata and controls

14 lines (12 loc) · 299 Bytes
title description author tags
Remove Duplicates
Removes duplicate values from an array.
technoph1le
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]