[Vuejs]-Remove duplicates in for loop โ€“ vue

0๐Ÿ‘

โœ…

I hope this helps you.

For example your array like this
products: ['Oculus', 'Google Glass', 'Microsoft Hololens', 'Oculus', 'Varjo']

and function for remove duplication is below

removeDuplicates () {
  this.products = [ ...new Set(this.products) ]
}

Leave a comment