网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  Set,Map

Set,Map

分类: IT文章 • 2022-05-20 17:25:53

  可以使用Set集合的不可重复性来处理js的数组去重:

const arr = [1, 2,null,'hellow', 'hellow', 2, null]
let set = new Set(arr);
console.log(Array.from(set)) // [1,2,null,'hellow']
console.log([...set]) // [1,2,null,'hellow']

相关推荐

  • Cannot set up a python SDK Python3.7. The SDK seems inval...  
  • C++中的unordered_map
  • redis list/hash/set
  • SQL SELECT SET
  • filter_map
  • Dynamics 365/CRM sql set context_info 切换数据库上下文
  • python描述符 描述符(__get__,__set__,__delete__)   再看property
  • 解决 Page 'http://localhost:63342/v3/js/math/math.map' requested without authorization页面未授权问题 解决 Page 'http://localhost:63342/v3/js/math/math.map' requested without authorization页面未授权问题
  • 关于Array.prototype.map 的 polyfill 函数中使用>>>的疑问,以及改进方法?
  • 集合 set
  • mysql 慢查询的原因分析点滴
  • Consul的分布式锁实现
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号