Quick Sort in Javascript