javascript sort (quick sort/bubble sort/insertion sort)