可以通过concat方法合并。但是concat并不能去重,需要使用new Set()方法去重
let a = ['1','2','4']
let b = ['1','3','5']
const x= [...new Set(a.concat(b))]
console.log(x)//['1','2','4','3','5']
可以通过concat方法合并。但是concat并不能去重,需要使用new Set()方法去重
let a = ['1','2','4']
let b = ['1','3','5']
const x= [...new Set(a.concat(b))]
console.log(x)//['1','2','4','3','5']