当前位置:网站首页>ES6 array de duplication new set()
ES6 array de duplication new set()
2022-07-25 13:29:00 【Psychosis】
Ordinary Array weight removal
var b = [...new Set([1,2, 3, 4, 5, 5, 5, 5])]
console.log(b);
De duplication of array containing objects
var o ={a:1}
var b = [...new Set([o, o, 3, 4, 5, 5, 5, 5])]
console.log(b);Output results :

There is a hole in the array containing objects , You need to pay attention to :
var b = [...new Set([{'a':1}, {'a':1}, 3, 4, 5, 5, 5, 5])]
console.log(b);Because every object is unique , So the two objects in this array cannot be duplicated

Remove duplicate characters from the string
[...new Set('ababbc')].join('')
// "abc"边栏推荐
- Arrays常用方法
- mujoco_ Py Chinese document
- 0713RHCSA
- Azure Devops(十四) 使用Azure的私有Nuget仓库
- Connotation and application of industrial Internet
- Excel添加按键运行宏
- How to realize the configuration method of user password free login?
- [six articles talk about scalablegnn] around www 2022 best paper PASCA
- [review SSM framework series] 15 - Summary of SSM series blog posts [SSM kill]
- 工业互联网的内涵及其应用
猜你喜欢

ThreadLocal&Fork/Join

【视频】马尔可夫链蒙特卡罗方法MCMC原理与R语言实现|数据分享

并发编程 — 内存模型 JMM

Based on Baiwen imx6ull_ Pro development board transplants LCD multi touch driver (gt911)

电脑里一辈子都不想删的神仙软件

0713RHCSA

Excel添加按键运行宏

深度学习的训练、预测过程详解【以LeNet模型和CIFAR10数据集为例】
![Detailed explanation of the training and prediction process of deep learning [taking lenet model and cifar10 data set as examples]](/img/70/2b5130be16d7699ef7db58d9065253.png)
Detailed explanation of the training and prediction process of deep learning [taking lenet model and cifar10 data set as examples]

Cv2.resize function reports an error: error: (-215:assertion failed) func= 0 in function ‘cv::hal::resize‘
随机推荐
Discussion on principle and application technology of MLIR
pytorch创建自己的Dataset加载数据集
Pycharm cannot input Chinese solution
并发编程之并发工具集
[Video] visual interpretation of Markov chain principle and Mrs example of R language region conversion | data sharing
6W+字记录实验全过程 | 探索Alluxio经济化数据存储策略
QingChuang technology joined dragon lizard community to build a new ecosystem of intelligent operation and maintenance platform
Common operations for Yum and VIM
Convolutional neural network model -- vgg-16 network structure and code implementation
【CSDN 年终总结】结束与开始,一直在路上—— “1+1=王”的2021总结
0717RHCSA
Jupyter Notebook介绍
[ai4code final chapter] alphacode: competition level code generation with alphacode (deepmind)
为提高效率使用ParallelStream竟出现各种问题
Friends let me see this code
arm架构移植alsa-lib和alsa-utils一路畅通
[six articles talk about scalablegnn] around www 2022 best paper PASCA
Canvas判断内容为空
[figure attack and Defense] backdoor attacks to graph neural networks (sacmat '21)
【GCN-RS】Towards Representation Alignment and Uniformity in Collaborative Filtering (KDD‘22)