let arr = [1, 2, 1, 3, 2, 4, 3, 5, 4] let newArr = [...new Set(arr)] console.log(newArr)
https://www.cnblogs.com/zhimao/p/15126281.html