wqh 2020-05-26 13:44:39

简单的数组去重

let a = [0,0,1,0,1,0,0,1,1,1,2,3,4,5,3,2,1];
let b = [... new Set(a)];
console.log(b);  //[0,1,2,3,4,5]

评论

首页 - Wiki
Copyright © 2011-2024 iteam. Current version is 2.130.1. UTC+08:00, 2024-07-27 23:04
浙ICP备14020137号-1 $访客地图$