This function takes first element as pivot , and places all the elements smaller than the pivot on the left side and all the elements greater than the pivot on the right side . It returns the index of the last element on the smaller side
function partition ( arr , low , high ) { let pivot = arr [ low ] ; let i = low - 1 , j = high + 1 ; while ( true ) {