add tests for javascript quick-sort
modify javascript quick-sort to copy input

otherwise, input parameter is changed.