Skip to content

Commit 874399e

Browse files
committed
Update reduce exercise
1 parent efb45af commit 874399e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

04 - Array Cardio Day 1/index-START.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@
7777
// create empty object & properties for each string & cumulative count
7878
console.table(
7979
data.reduce((obj, it) => {
80-
if (obj[it] == undefined) { obj[it] = 0 }
81-
else { obj[it]++ }
80+
if (!obj[it]) { obj[it] = 0 }
81+
obj[it]++
8282
return obj
8383
}, {})
8484
)

0 commit comments

Comments
 (0)