Skip to content

Commit 2dbfc5d

Browse files
committed
Fix quick select return values
1 parent 129de26 commit 2dbfc5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/searching/quickselect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
}
4242

4343
if (arr.length <= n) {
44-
return NaN;
44+
return undefined;
4545
}
4646
lo = lo || 0;
4747
hi = hi || arr.length - 1;
@@ -60,7 +60,7 @@
6060
lo = pivotIdx + 1;
6161
}
6262
}
63-
return NaN;
63+
return undefined;
6464
}
6565
exports.quickselect = quickselect;
6666

0 commit comments

Comments
 (0)