Skip to content

Commit 499ab17

Browse files
fitiskind4rkr00t
authored andcommitted
fix: Passed array should not be sorted
fix #98
1 parent 60876ed commit 499ab17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function percentile(p, list, fn) {
5555
throw new Error(graterThanHundredError(p));
5656
}
5757

58-
list = list.sort(function (a, b) {
58+
list = list.slice().sort(function (a, b) {
5959
if (fn) {
6060
a = fn(a);
6161
b = fn(b);

0 commit comments

Comments
 (0)