DEV Community

Discussion on: Removing duplicates from an array

Collapse
 
gmkumar08 profile image
Manoj Kumar

If you're lazy like me :D and already using Lodash in your project, you can do the following:

const array = [1, 1, 1, 3, 3, 2, 2];
_.uniq(array);