📜  javascript 数组 distinct - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:12.411000             🧑  作者: Mango

代码示例5
var myArray = ['a', 1, 'a', 2, '1'];

let unique = [...new Set(myArray)];

console.log(unique); // unique is ['a', 1, 2, '1']