const arr1 = [1, 2, 3, 4, 5, 8, 9] const arr2 = [5, 6, 7, 8, 9]; const result = arr1.concat(arr2.filter(v => !arr1.includes(v))) console.log(result) //[1, 2, 3, 4,5, 8, 9]
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8