I saw this implementation of merge sort in javascript :
const merge = (arr1 , arr2) => { let sorted = []; let i = 0 , j = 0; while(i < arr1.len