Skip to content

Commit 30e690a

Browse files
authored
Refactor tally function to use Object.hasOwn
1 parent 7c56ceb commit 30e690a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Sprint-2/implement/tally.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function tally() {
22
const counts = {};
33

44
for (const item of items) {
5-
if (counts[item] === undefined) {
5+
if (!Object.hasOwn(counts, item)) {
66
counts[item] = 1;
77
} else {
88
counts[item]++;

0 commit comments

Comments
 (0)