📅  最后修改于: 2022-03-11 15:02:28.761000             🧑  作者: Mango
let a = [10,20,30,50,30];
let b = a.reduce((unique,item) => unique.includes(item) ? unique: [... unique, item] ,[]);
console.log(b);