Quicksort in JS