Last active
October 5, 2021 18:17
-
-
Save sayyedhammadali/4f9ddd71e575fa9d4601ac58683f6196 to your computer and use it in GitHub Desktop.
Remove Duplicates in an Array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const removeDuplicates = (arr) => [...new Set(arr)]; | |
removeDuplicates([31, 56, 12, 31, 45, 12, 31]); | |
//[ 31, 56, 12, 45 ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment