📌  相关文章
📜  如何在javascript代码示例中删除相同的字符串

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

代码示例1
const names = ['John', 'Paul', 'George', 'Ringo', 'John'];

let x = (names) => names.filter((v,i) => names.indexOf(v) === i)
x(names); // 'John', 'Paul', 'George', 'Ringo'