Skip to content

Commit ccce688

Browse files
Final change before re submit
1 parent 2a3243b commit ccce688

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Sprint-2/implement/tally.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ function tally(sumArray) {
55
}
66
let totalSum = {};
77
for (const item of sumArray) {
8-
if (totalSum[item] === undefined) {
8+
if (!Object.hasOwn(totalSum, item)) {
99
totalSum[item] = 1;
1010
} else {
1111
totalSum[item] += 1;
1212
}
1313
}
1414
return totalSum;
1515
}
16-
1716
module.exports = tally;

0 commit comments

Comments
 (0)