We all know you can do:
let arr1 = [1,2,3]; let arr2 = [3,4,5]; let arr3 = [...arr1, ...arr2]; // [1,2,3,3,4,5]
But how do you make this dynami
We can resolve using es6 following way
function mergeTwo(arr1, arr2) { let result = [...arr1, ...arr2]; return result.sort((a,b) => a-b); }