过于简单直接上代码 let arr = [1,1,1,1,2,2,2,2,2,3,3,3,3]; arr = Array.from(new Set(arr)); console.log(arr);//[1,2,3]