[Vuejs]-Vue remove duplicate values after sort function

0👍

You can use either of the following to remove duplicates out of a sorted array.

items.arrivalTime = items.arrivalTime.filter((item, index) => items.arrivalTime.indexOf(item) === index)

or

items.arrivalTime = [...new Set(items.arrivalTime)]

Leave a comment