Remove array duplicates

const arr = [1, 1, 2, 3, 5, 8];

[...new Set(arr)] // [1, 2, 3, 5, 8]
  • javascript