Original array is broken in two parts left and right array
let len1 = m - l + 1 , len2 = r - m ; let left = new Array ( len1 ) ; let right = new Array ( len2 ) ; for ( let x = 0 ; x < len1 ; x ++ ) { left [ x ] = arr [ l + x ] ; } for ( let x = 0 ; x < len2 ; x ++ ) { right [ x ] = arr [ m + 1 + x ] ; } let i = 0 ; let j = 0 ; let k = l ;