1613 Views
Set is a object that cannot have duplicate entries. You can create a new Set from an array then convert it back to an array. const array = [1,2,2,3];const arrayWithDups = Array.from(new Set(array)); //returns new array without duplicates, [1,2,3] Returns a new array from startIndex to endIndex - 1 .
0 comments