5
第 33 题:如何去掉一组整型数组重复的值?
source link: https://segmentfault.com/a/1190000040582129
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
利用 ES6 新增的数据结构 Set 实现
let arr = [20, 28, 28, 30, 28, 50, 40]; let res = [...new Set(arr)]; console.log(res); // [20, 28, 30, 50, 40]
文章的内容/灵感都从下方内容中借鉴
- 【持续维护/更新 500+前端面试题/笔记】https://github.com/noxussj/In...
- 【大数据可视化图表插件】https://www.npmjs.com/package...
- 【利用 THREE.JS 实现 3D 城市建模(珠海市)】https://3d.noxussj.top/
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK