js数组去重利用setconst nums = [1,2,3,4,3,2,1] uniq1 = [...new Set(nums)] uniq2 = Array.from(new Set(nums)) 定义:新数据结构Set,类似于数组,但成员值不重2023-04-23JavaScript260