Remove Duplicates The Shortest Way

Remove Duplicates The Shortest Way
33 7
function removeDuplicate(arr) {
  return [...new Set(arr)]
}

Remove duplicates from an array in javascript the shortest way.👍Using Set object where it only contains unique values (remove repeated ones). Then with spread operator spreads the values into an array again. 😎

Entfernen Sie Duplikate auf kürzestem Weg aus einem Array in #Javascript. Dann spreizt der Operator mit spread die Werte wieder in ein Array.

Build with &
Edit dev-to-clone-nuxt Edit dev-to-clone-nuxt