📜  从地图反应js中删除重复值 - Javascript代码示例

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

代码示例1
var sandwiches = ['turkey', 'ham', 'turkey', 'tuna', 'pb&j', 'ham', 'turkey', 'tuna'];
var deduped = Array.from(new Set(sandwiches));

// Logs ["turkey", "ham", "tuna", "pb&j"]
console.log(deduped);