Skip to content

Commit df15fa7

Browse files
Merge pull request #237 from HackYourFuture-CPH/js-week4-char-count-exercise
Js week4 char count exercise - suggested adjustment
2 parents 57b3cc0 + f2c196e commit df15fa7

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

courses/foundation/intro-to-javascript/week2/assignment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Why should I even do this assignment?
44

5-
Functions and conditions are some of the basic building blocks of javascript. Functions ensure that we don't repeat ourselves when writing code. Conditions ensures that we can handle different cases when programming.
5+
Functions and conditions are some of the basic building blocks of javascript. Functions ensure that we don't repeat ourselves when writing code. Conditions ensure that we can handle different cases when programming.
66

77
If you struggle to do this weeks assignment, read up on [JavaScript basics](README.md#recap-logical-operators).
88

courses/foundation/intro-to-javascript/week4/session-plan.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ Write a function that counts the frequency of characters in a string:
113113
```js
114114
console.log(getCharacterFrequencies("happy"));
115115
/*
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. Hint: Think about using object property accessors.
126+
For a bigger challenge, you can try to write the same function for a different expected output as seen below. It will require implementing some additional logic.
127+
128+
```js
129+
/*
116130
{
117131
characters: [
118132
{

0 commit comments

Comments
 (0)