当前位置:网站首页>Native JS array some method de duplication
Native JS array some method de duplication
2022-06-25 19:16:00 【Good first】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
//some() As long as there is one satisfaction, return true;
var arr = [1, 1, 2, 2, 3, 3, 2, 4, 1];
var newArr = [];
for (let i = 0; i < arr.length; i++) {
if (newArr.some(item => item == arr[i])) {
continue; // Continue to cycle
}
newArr.push(arr[i]);
}
console.log(newArr);
</script>
</body>
</html>
边栏推荐
- Cutting feet to fit shoes - talking about the ramp reconstruction on the track
- On Oracle full stack virtual machine -- graalvm
- Is it safe for tongdaxin to open an account?
- 什么是算子?
- Tcp/ip test questions (III)
- Leetcode-78-subset
- ECS 7-day practical training camp (Advanced route) -- day04 -- build a portal using ECs and polardb
- Apifox simple understanding -- the integrator of web side testing
- Paddleocr learning (II) paddleocr detection model training
- Miner's Diary: why should I go mining on April 5, 2021
猜你喜欢
![[C language practice - print the upper triangle and its deformation (with blank version)]](/img/df/f38dc57c6a2de522acd91929ced1ad.png)
[C language practice - print the upper triangle and its deformation (with blank version)]

Elastic high-performance computing on the cloud supports the rapid development of the life science industry, reducing costs and increasing efficiency

2020-12-09 laravel . Env file loading mechanism process

QQ机器人:群成员自我禁言管理【最新beta2版本】

云上弹性高性能计算,支持生命科学产业高速发展、降本增效
![Analysis on development status and development suggestions of e-commerce industry in Xinjiang in 2020 [figure]](/img/d1/8ed2958ef365e17494bade6e29ee04.jpg)
Analysis on development status and development suggestions of e-commerce industry in Xinjiang in 2020 [figure]

ECS 7-day practical training camp (Advanced route) -- day01 -- setting up FTP service based on ECS

How to quickly close port 8080
![In 2021, China's private equity market is growing, and the scale of private equity fund management reaches 19.78 trillion yuan [figure]](/img/e9/ffc5303cb6f0f8e05e93b3342a49b2.jpg)
In 2021, China's private equity market is growing, and the scale of private equity fund management reaches 19.78 trillion yuan [figure]
![QQ robot: self forbidden words management of group members [latest beta2 version]](/img/1b/7dcc8ed344c9f62870d76f16b99f1d.png)
QQ robot: self forbidden words management of group members [latest beta2 version]
随机推荐
R语言plotly可视化:plotly可视化二维直方图等高线图(Basic 2D Histogram Contour)
Does GoogleSEO need to change the friend chain? (e6zzseo)
PostgreSQL division considerations
JVM|运行时数据区(堆空间)
Analysis on planting area, output and import of sugarcane in Guangxi in 2021: the output of sugarcane in Guangxi accounts for 68.56% of the total output of sugarcane in China [figure]
Embark on a new journey and reach the world with wisdom
1、 Hikaricp source code analysis of connection acquisition process I
Install spoole
Validation of TTF font by validator of laravel
Divine reversion EA
【历史上的今天】6 月 25 日:笔记本之父诞生;Windows 98 发布;通用产品代码首次商用
Trend ea- fixed stop loss and profit per order
Network security detection and prevention test questions (4)
LeetCode-78-子集
Network security detection and prevention exercises (III)
3、 Hikaricp source code analysis of connection acquisition process III
Network security detection and prevention test questions (I)
Network security detection and prevention test questions (V)
QQ机器人官方插件加载配置方法【beta2版本】
Lilda Bluetooth air conditioning receiver helps create a more comfortable road life