Remove Duplicates from Array with 1 line of code

UmerFarooq
May 15, 2021

--

Removing duplicates from the array is part of a workflow from day to day and we do that with a single function and is easier than ever.

const removeDuplicates=(array)=> [...new Set(array)]

Demo

That’s it

--

--

UmerFarooq
UmerFarooq

Written by UmerFarooq

I am a full-stack engineer always curious about how to get things better and in a more productive/ lazy manner. https://umerfarooq.dev

No responses yet