Remove Duplicates

Function to remove duplicates from an array
Function remove duplicates array

Function unique array
Const seen elements
Equals new set
For let element of array

If seen elements has element
Seen elements has element
Seen elements add, element
Unique array, push, element
Return unique array

Seen elements has element
Seen elements has element
Seen elements add element
Unique array, push, element
Return unique array

Example usage
Const numbers, one, two, two, three, four, four, five
Console log array without duplicates
Remove duplicates numbers



Credits
Writer(s): Serdar Temel
Lyrics powered by www.musixmatch.com

Link