Q:

write a function that takes in 2 arrays , merges them together an then return the new array sorted

// const newSortArrays = (arr1, arr2) => {
//     let output = [];
//     while (arr1.length && arr2.length) {
//        if (arr1[0] < arr2[0]) 
//         output.push(arr1[0] < arr2[0] ? arr1.shift() : arr2.shift())
//     }
//     return [...output, ...arr1, ...arr2]
// }
2
// const twoArraysSorted = (arr) => {
//     let copy = [...];
//     copy.sort((a,b) => a-b).map(el=> el*2)
//     return arr
// }
0

New to Communities?

Join the community