9 February 2024

This snippet uses a combination of Set and Array.from() to filter out duplicate values and convert the result back into an array. When you initialize a Set with an array, it automatically removes any duplicate values.

Source code viewer
  1. const uniqueArray = Array.from(new Set(yourArray));
Programming Language: Javascript