js: in place quick sort