当前位置:网站首页>JS merge two one-dimensional arrays and remove the same items (collation)
JS merge two one-dimensional arrays and remove the same items (collation)
2022-06-29 17:55:00 【I am happy】
// Declare two arrays
let arr1 = [1,2,3,4,5,'b'];
let arr2 = ['a',1,'b',5,4];
// First combine the two arrays into an array
// Use concat
let cArr = arr2.concat(arr1);
// Use for loop
for(let i = 0; i < arr1.length; i++){
arr2.push(arr1[i]);
}
// And then through the merged array call Array.from(new Set( Parameters are arrays ));
let arr = Array.from(new Set(arr2));
console.log(arr);
边栏推荐
猜你喜欢

小程序容器是什么技术?能助力物联网企业红海突围?

QQ如何开通在线客服

阿里云不同账号新旧服务器镜像迁移数据迁移同步
![[webdriver] upload files using AutoIT](/img/69/8c27626d515976b47f1df4831d09c8.png)
[webdriver] upload files using AutoIT

面试中问最常问的海量数据处理你拿捏了没?

SRM供应商协同管理系统功能介绍

How MySQL queries character set codes of tables

小迈科技 X Hologres:高可用的百亿级广告实时数仓建设

On adding and subtracting dates

Openfeign use step polling strategy and weight log4j configuration of openfeign interceptor
随机推荐
SRM supplier collaborative management system function introduction
VB.Net读写NFC Ntag标签源码
Teach you how to install the latest version of mysql8.0 database on windows, nanny level teaching
布隆过滤器:
基于STM32F103ZET6库函数定时器中断实验
[网鼎杯 2020 青龙组]AreUSerialz
3h精通OpenCV(七)-颜色检测
QQ如何开通在线客服
What is the MySQL query view command
关于日期相加减问题
Web Scraping with Beautiful Soup for Data Scientist
Parental delegation mechanism
双亲委派机制
SSH协议学习笔记
reflex
MATLAB 最远点采样(FPS)
Premature end of script headers 或 End of script output before headers
【Try to Hack】Cookie和Session
人脸识别4-百度商用方案调研
DevCloud加持下的青软,让教育“智”上云端