1142 0 0 0
Last Updated : 2025-04-28 22:50:59
In order to get the unique values from an array , there are many ways, through using Set , or filter() method on array values or other methods.
var myArray = ['a', 1, 'a', 2, '1'];
let unique = [...new Set(myArray)];
// unique is ['a', 1, 2, '1']
//---------------------------------
var uniqueItems = Array.from(new Set(myArray ))?
Read Also