You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: courses/foundation/intro-to-javascript/week4/session-plan.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,20 @@ Write a function that counts the frequency of characters in a string:
113
113
```js
114
114
console.log(getCharacterFrequencies("happy"));
115
115
/*
116
+
{
117
+
h: 1,
118
+
a: 1,
119
+
p: 2,
120
+
y: 1
121
+
}
122
+
*/
123
+
```
124
+
125
+
The expected output above allows for a relatively simple solution mechanism. Think about object property accessors.
126
+
For a bigger challenge, you can try to write the same function for a different exptected output as seen bellow. It will require implementing some additional logic.
0 commit comments