mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-25 02:14:11 -05:00
fix(curriculum): Maintain getMode function consistency in steps 39 - 59 (#62313)
This commit is contained in:
@@ -132,9 +132,8 @@ const getMedian = (array) => {
|
||||
--fcc-editable-region--
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -140,9 +140,8 @@ const getMedian = (array) => {
|
||||
--fcc-editable-region--
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -126,9 +126,8 @@ const getMedian = (array) => {
|
||||
--fcc-editable-region--
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -130,9 +130,8 @@ const getMedian = (array) => {
|
||||
--fcc-editable-region--
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -132,9 +132,8 @@ const getMedian = (array) => {
|
||||
--fcc-editable-region--
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -123,9 +123,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -159,9 +159,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -123,9 +123,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -137,9 +137,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -135,9 +135,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -143,9 +143,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -143,9 +143,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -161,9 +161,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -147,9 +147,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -125,9 +125,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -123,9 +123,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -137,9 +137,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -146,9 +146,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -119,9 +119,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -117,9 +117,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -125,9 +125,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
@@ -281,9 +280,8 @@ const getMedian = (array) => {
|
||||
|
||||
const getMode = (array) => {
|
||||
const counts = {};
|
||||
array.forEach((el) => {
|
||||
counts[el] = (counts[el] || 0) + 1;
|
||||
})
|
||||
array.forEach(el => counts[el] = counts[el] ? counts[el] + 1 : 1);
|
||||
|
||||
if (new Set(Object.values(counts)).size === 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user