We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63f79bb commit 95d7bddCopy full SHA for 95d7bdd
Sprint-1/fix/median.js
@@ -11,7 +11,7 @@ function calculateMedian(list) {
11
return null;
12
} else {
13
// Get only numeric values
14
- const numericList = list.filter((item) => typeof item === "number");
+ const numericList = list.filter((item) => Number.isFinite(item));
15
// Check if its empty after filtering
16
if (numericList.length === 0) {
17
0 commit comments