Answers for "merg two array js"

0

merg two array js

let ar1 = [1,2,3,4,5]
let ar2 = [6,7,8,9,10]

let merge = [...ar1,...ar2]
console.log(merge) // [1,2,3,4,5,6,7,8,9,10]
Posted by: Guest on June-15-2021
0

array merge in javascript

function mergeArrays(arr1, arr2) {
  return Array.from(new Set(arr1.concat(arr2).sort((a,b) => (a-b))));
}
Posted by: Guest on March-16-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language