diff --git a/courses/foundation/intro-to-javascript/week2/assignment.md b/courses/foundation/intro-to-javascript/week2/assignment.md index cbad31e4..0629d911 100644 --- a/courses/foundation/intro-to-javascript/week2/assignment.md +++ b/courses/foundation/intro-to-javascript/week2/assignment.md @@ -2,7 +2,7 @@ ## Why should I even do this assignment? -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. +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. If you struggle to do this weeks assignment, read up on [JavaScript basics](README.md#recap-logical-operators). diff --git a/courses/foundation/intro-to-javascript/week4/session-plan.md b/courses/foundation/intro-to-javascript/week4/session-plan.md index 4ae2a34a..efd10ad4 100644 --- a/courses/foundation/intro-to-javascript/week4/session-plan.md +++ b/courses/foundation/intro-to-javascript/week4/session-plan.md @@ -113,6 +113,20 @@ Write a function that counts the frequency of characters in a string: ```js console.log(getCharacterFrequencies("happy")); /* +{ + h: 1, + a: 1, + p: 2, + y: 1 +} +*/ +``` + +The expected output above allows for a relatively simple solution mechanism. Hint: Think about using object property accessors. +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. + +```js +/* { characters: [ {