From d00f2bb01a7cf14cfea520f38addcb2b773cd85f Mon Sep 17 00:00:00 2001 From: Rachel Evans Date: Tue, 29 Apr 2025 18:49:56 +0200 Subject: [PATCH] Use "e.g." for examples, not "fx" --- legacy/databases/lesson3/README.md | 46 +++++++++---------- .../lesson3/social_media_exercise.md | 2 +- .../guides/making-your-API-guide.md | 2 +- .../javascript1/week1/lesson-plan.md | 2 +- legacy/javascript/javascript1/week2/README.md | 6 +-- .../javascript1/week2/lesson-plan.md | 4 +- .../javascript/javascript1/week3/homework.md | 2 +- .../javascript1/week3/lesson-plan.md | 2 +- .../javascript/javascript1/week4/homework.md | 4 +- .../javascript1/week4/lesson-plan.md | 8 ++-- legacy/javascript/javascript2/week1/README.md | 2 +- .../javascript2/week1/lesson-plan.md | 2 +- .../javascript2/week1/optional-homework.md | 4 +- .../javascript2/week2/lesson-plan.md | 6 +-- .../javascript2/week2/optional-homework.md | 10 ++-- legacy/javascript/javascript2/week3/README.md | 2 +- .../javascript2/week3/lesson-plan.md | 6 +-- .../javascript2/week3/optional-homework.md | 4 +- .../javascript3/week1/lesson-plan.md | 4 +- .../javascript3/week1/optional-homework.md | 4 +- .../javascript3/week2/lesson-plan.md | 6 +-- .../javascript3/week3/lesson-plan.md | 2 +- legacy/nodejs/week1/lesson-plan.md | 2 +- legacy/nodejs/week2/lesson-plan.md | 2 +- legacy/nodejs/week3/lesson-plan.md | 2 +- 25 files changed, 69 insertions(+), 67 deletions(-) diff --git a/legacy/databases/lesson3/README.md b/legacy/databases/lesson3/README.md index 77f4c540..d53c39a6 100644 --- a/legacy/databases/lesson3/README.md +++ b/legacy/databases/lesson3/README.md @@ -69,33 +69,33 @@ Create these queries #### Meal -| Queries to write | -| ----------------------------------------------------------------------------------------- | -| Get all meals | -| Add a new meal | -| Get a meal with any id, fx 1 | -| Update a meal with any id, fx 1. Update any attribute fx the title or multiple attributes | -| Delete a meal with any id, fx 1 | +| Queries to write | +| --------------------------------------------------------------------------------------------- | +| Get all meals | +| Add a new meal | +| Get a meal with any id, e.g. 1 | +| Update a meal with any id, e.g. 1. Update any attribute e.g. the title or multiple attributes | +| Delete a meal with any id, e.g. 1 | #### Reservation -| Queries to write | -| ------------------------------------------------------------------------------------------------ | -| Get all reservations | -| Add a new reservation | -| Get a reservation with any id, fx 1 | -| Update a reservation with any id, fx 1. Update any attribute fx the title or multiple attributes | -| Delete a reservation with any id, fx 1 | +| Queries to write | +| ---------------------------------------------------------------------------------------------------- | +| Get all reservations | +| Add a new reservation | +| Get a reservation with any id, e.g. 1 | +| Update a reservation with any id, e.g. 1. Update any attribute e.g. the title or multiple attributes | +| Delete a reservation with any id, e.g. 1 | #### Review -| Queries to write | -| ------------------------------------------------------------------------------------------- | -| Get all reviews | -| Add a new review | -| Get a review with any id, fx 1 | -| Update a review with any id, fx 1. Update any attribute fx the title or multiple attributes | -| Delete a review with any id, fx 1 | +| Queries to write | +| ----------------------------------------------------------------------------------------------- | +| Get all reviews | +| Add a new review | +| Get a review with any id, e.g. 1 | +| Update a review with any id, e.g. 1. Update any attribute e.g. the title or multiple attributes | +| Delete a review with any id, e.g. 1 | #### Additional queries @@ -103,11 +103,11 @@ Now add a couple of different meals, reservations and reviews with different att | Functionality | | -------------------------------------------------------------------------------------------------------------- | -| Get meals that has a price smaller than a specific price fx 90 | +| Get meals that has a price smaller than a specific price e.g. 90 | | Get meals that still has available reservations | | Get meals that partially match a title. `Rød grød med` will match the meal with the title `Rød grød med fløde` | | Get meals that has been created between two dates | -| Get only specific number of meals fx return only 5 meals | +| Get only specific number of meals e.g. return only 5 meals | | Get the meals that have good reviews | | Get reservations for a specific meal sorted by created_date | | Sort all meals by average number of stars in the reviews | diff --git a/legacy/databases/lesson3/social_media_exercise.md b/legacy/databases/lesson3/social_media_exercise.md index b7d3849e..8a97ed4b 100644 --- a/legacy/databases/lesson3/social_media_exercise.md +++ b/legacy/databases/lesson3/social_media_exercise.md @@ -55,4 +55,4 @@ It should however **not** be possible for a user to react to something with the ### Friendship -Fx: User 1 is friends with user 2 +e.g. User 1 is friends with user 2 diff --git a/legacy/javascript/homework-projects/guides/making-your-API-guide.md b/legacy/javascript/homework-projects/guides/making-your-API-guide.md index fa13a714..acf81935 100644 --- a/legacy/javascript/homework-projects/guides/making-your-API-guide.md +++ b/legacy/javascript/homework-projects/guides/making-your-API-guide.md @@ -24,7 +24,7 @@ If you already have such a repository, just go on to the next step. 1. Once the repository has been made, head over to your terminal and clone that repository into a directory of your choosing. 2. Once the repository been cloned to your computer, open the project folder in VS Code. -3. Create a folder for your APIs or just create a file in the root of the repository. You might want to organize it into a folder (fx. “data”) if you plan to create more APIs in the future and/or if you plan to also host your site on Github Pages. In the case of your JS project, you would just copy and paste the array of objects that you have been using so far and perhaps add more objects to it, if needed. +3. Create a folder for your APIs or just create a file in the root of the repository. You might want to organize it into a folder (e.g. “data”) if you plan to create more APIs in the future and/or if you plan to also host your site on Github Pages. In the case of your JS project, you would just copy and paste the array of objects that you have been using so far and perhaps add more objects to it, if needed. 4. Once you are ready with your JSON file, add, commit and push the changes to `main` so that you have the file on your repository. 5. Head over to the repo on GitHub and verify that your file is there and that all is good. diff --git a/legacy/javascript/javascript1/week1/lesson-plan.md b/legacy/javascript/javascript1/week1/lesson-plan.md index 0e573257..cf1a3dcb 100644 --- a/legacy/javascript/javascript1/week1/lesson-plan.md +++ b/legacy/javascript/javascript1/week1/lesson-plan.md @@ -7,7 +7,7 @@ Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!! diff --git a/legacy/javascript/javascript1/week2/README.md b/legacy/javascript/javascript1/week2/README.md index 4890c1f1..f91cebdc 100644 --- a/legacy/javascript/javascript1/week2/README.md +++ b/legacy/javascript/javascript1/week2/README.md @@ -7,7 +7,7 @@ - [ ] Global vs local scope - [ ] For loop -Teaching note. Start off explaining functions with how to use a function fx explain why the Math.random function is smart, or Math.max. +Teaching note. Start off explaining functions with how to use a function e.g. explain why the Math.random function is smart, or Math.max. ## Relevant links @@ -78,7 +78,7 @@ console.log(randomNumber); // logs out some number between 0 and 1 Here `Math.random` is a function. To activate the function we call it using parentheses `()`. When calling it we get a randomNumber! We now don't need to think about all the code it takes to create a random number in javascript, we simply call the function and get a random number. Code has been abstracted away for us! -Some functions is called with arguments fx: +Some functions is called with arguments, for example: ```js const maxNumber = Math.max(3, 5); // 3 and 5 are arguments @@ -142,7 +142,7 @@ multiply(10 * 4); ##### Return value -Sometimes we want to get a value back when calling a function. Fx in the sum example. We want to call the function and get the sum back! +Sometimes we want to get a value back when calling a function. e.g. in the sum example. We want to call the function and get the sum back! ```js function sum(a, b) { diff --git a/legacy/javascript/javascript1/week2/lesson-plan.md b/legacy/javascript/javascript1/week2/lesson-plan.md index a8088479..913f6c50 100644 --- a/legacy/javascript/javascript1/week2/lesson-plan.md +++ b/legacy/javascript/javascript1/week2/lesson-plan.md @@ -7,7 +7,7 @@ Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!! @@ -38,7 +38,7 @@ If you find anything that could be improved then please create a pull request! W - [Exercise string logger](#for-loop-1) - [Exercise send emails](#send-emails) -The students really struggle with the **return** value. What it means, how it is captured. What happens when nothing is returned etc. Try really hammering in this concept with lots of simple examples and exercises! Fx if a function is called get something. That means that something is returned from that function. +The students really struggle with the **return** value. What it means, how it is captured. What happens when nothing is returned etc. Try really hammering in this concept with lots of simple examples and exercises! e.g. if a function is called get something. That means that something is returned from that function. Zoey Zou made a nice Notion lesson plan here: diff --git a/legacy/javascript/javascript1/week3/homework.md b/legacy/javascript/javascript1/week3/homework.md index 72c0c805..747b675b 100644 --- a/legacy/javascript/javascript1/week3/homework.md +++ b/legacy/javascript/javascript1/week3/homework.md @@ -4,7 +4,7 @@ Array's has lots of helper functions, that is used all the time when developing js applications. It is super helpful to be able to **manipulate an array** like **removing elements** or **adding elements** at specific indexes. Another helpful function of arrays is to know **where a specific item is** in the array. -Objects can be used for **representing data** and it can **help structure your code**. An object can fx represent a user that has a firstname, surname, profile picture and a list of friends. It is constantly used in javascript and **essential to learning the language**. +Objects can be used for **representing data** and it can **help structure your code**. An object can e.g. represent a user that has a firstname, surname, profile picture and a list of friends. It is constantly used in javascript and **essential to learning the language**. If you struggle to do this weeks homework there are a couple of things to do: diff --git a/legacy/javascript/javascript1/week3/lesson-plan.md b/legacy/javascript/javascript1/week3/lesson-plan.md index aee8f6ad..bf6cf2f1 100644 --- a/legacy/javascript/javascript1/week3/lesson-plan.md +++ b/legacy/javascript/javascript1/week3/lesson-plan.md @@ -7,7 +7,7 @@ Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!! diff --git a/legacy/javascript/javascript1/week4/homework.md b/legacy/javascript/javascript1/week4/homework.md index 5db9fe43..70a9d06f 100644 --- a/legacy/javascript/javascript1/week4/homework.md +++ b/legacy/javascript/javascript1/week4/homework.md @@ -36,9 +36,9 @@ These are the commands you should be able to give the voice assistant: - `Add fishing to my todo` - Should respond with "fishing added to your todo". Should add fishing to a list of todos - `Add singing in the shower to my todo` - Should add singing in the shower to a list of todos - `Remove fishing from my todo` - Should respond with "Removed fishing from your todo" -- `What is on my todo?` - should respond with the todos. Fx you have 2 todos - fishing and singing in the shower +- `What is on my todo?` - should respond with the todos. e.g. you have 2 todos - fishing and singing in the shower - `What day is it today?` - Should respond with the date in a human readable format. E.g. if today is 30/8/2019 then it should respond with 30. of August 2019 -- Should be able to do simple math. fx `what is 3 + 3` should respond with 6. Or `what is 4 * 12` should respond with 48 +- Should be able to do simple math. e.g. `what is 3 + 3` should respond with 6. Or `what is 4 * 12` should respond with 48 - `Set a timer for 4 minutes` - Should respond with "Timer set for 4 minutes". When 4 minutes is up: "Timer done". How do we set a timer in js? Google is your friend here! - Add one or more command to your voice assistant diff --git a/legacy/javascript/javascript1/week4/lesson-plan.md b/legacy/javascript/javascript1/week4/lesson-plan.md index 967e49d9..28ae36f4 100644 --- a/legacy/javascript/javascript1/week4/lesson-plan.md +++ b/legacy/javascript/javascript1/week4/lesson-plan.md @@ -7,7 +7,7 @@ Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!! @@ -74,7 +74,7 @@ When that works. Make the two number for multiples into parameters. So it can be A sentiment analyzer is some functionality that figures out how positive/negative a sentence is. -Fx the sentence `I am mega super awesome happy" Should have a high score +For example, the sentence `I am mega super awesome happy" Should have a high score The sentence "I hate doing boring stuff" should have a low score. Create a function that takes a string as a parameter. calling the function will return an object with `score`, `positiveWords` and `negativeWords`. You decide how the score should be implemented and what words are negative and positive. @@ -96,7 +96,9 @@ console.log(sentimentScoreObject); ### Credit card number formatter -This is a very real world example of a problem i got at my previous work. I was tasked to implement one of the smart credit card input fields, where the credit card numbers are separated with a space. Fx inputting 123456789 would show 1234 5678 9. +This is a very real world example of a problem i got at my previous work. I +was tasked to implement one of the smart credit card input fields, where the +credit card numbers are separated with a space. e.g. inputting 123456789 would show 1234 5678 9. ![Credit card formatter](assets/credit-card-formatter.gif) diff --git a/legacy/javascript/javascript2/week1/README.md b/legacy/javascript/javascript2/week1/README.md index 6b1c1fa1..a02aa209 100644 --- a/legacy/javascript/javascript2/week1/README.md +++ b/legacy/javascript/javascript2/week1/README.md @@ -127,7 +127,7 @@ Events in JavaScript are things like: A timer has just finished, a user clicked a button, our page has loaded, someone types into an input element or we have just gotten some data from a server. When these events happen, we usually want to add some functionality. -Fx when a user clicks the like button (event), we want to increment the like counter and color the like button blue. +For example, when a user clicks the like button (event), we want to increment the like counter and color the like button blue. Or when someone clicks "Close cookies" (event) we want to remove the cookie div. Lets first try to create some js that waits for 2 seconds and the console.logs out "2 seconds has elapsed!" diff --git a/legacy/javascript/javascript2/week1/lesson-plan.md b/legacy/javascript/javascript2/week1/lesson-plan.md index 7adc8830..8ae5ec80 100644 --- a/legacy/javascript/javascript2/week1/lesson-plan.md +++ b/legacy/javascript/javascript2/week1/lesson-plan.md @@ -7,7 +7,7 @@ Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!! diff --git a/legacy/javascript/javascript2/week1/optional-homework.md b/legacy/javascript/javascript2/week1/optional-homework.md index 9745c449..f7348294 100644 --- a/legacy/javascript/javascript2/week1/optional-homework.md +++ b/legacy/javascript/javascript2/week1/optional-homework.md @@ -38,7 +38,7 @@ notThisFunctionName(danishString2); // returns {total: 4, æ: 1, ø: 2, å: 1} ## 2. Spirit animal name generator -Let's create a page where **a user writes his name** in an input element. The user then clicks a button. The user will now **receive a spirit animal name**, fx Benjamin - The fullmoon wolf. +Let's create a page where **a user writes his name** in an input element. The user then clicks a button. The user will now **receive a spirit animal name**, e.g. Benjamin - The fullmoon wolf. ### 2.1. Markup time! @@ -50,7 +50,7 @@ When the user clicks the button, get the name the user wrote in the input field. ### 2.3. Spirit animal part -Now we can get the users name, next step is to **add the spirit animal string** and display that the users name, a dash and then the spirit animal. Fx Name: Peter: Peter - The crying butterfly +Now we can get the users name, next step is to **add the spirit animal string** and display that the users name, a dash and then the spirit animal. e.g. Name: Peter: Peter - The crying butterfly For creating the spirit animal create an array with 10 string representing spirit animals. Now get a random item in the array that will represent the spirit animal. ### 2.4. New spirit animal diff --git a/legacy/javascript/javascript2/week2/lesson-plan.md b/legacy/javascript/javascript2/week2/lesson-plan.md index f9455976..9918ea8a 100644 --- a/legacy/javascript/javascript2/week2/lesson-plan.md +++ b/legacy/javascript/javascript2/week2/lesson-plan.md @@ -13,7 +13,7 @@ These are some examples of previously created materials by mentors that you can Remember to add the code you wrote in the class to the relevant class's work folder on a branch. If the branch has not been created just create and push it :) If you don't have access, write to someone from the core team. You can see an example below! -To find examples of what teachers have taught before, go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before, go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved, please create a pull request! We welcome changes, so please get involved if you have any ideas!!! @@ -353,11 +353,11 @@ Rewrite the code above (`forEach`, `map` and `filter`) to arrow functions. ### Listing project -Imagine we have a website like where a user can search for different parameters. Fx What type the listing should be, the price, size, location etc etc. +Imagine we have a website like where a user can search for different parameters. e.g. What type the listing should be, the price, size, location etc etc. #### Filter listings -If a user fx click on a button indicating that the user only wants listings that are of the type farm. Lets try and imagine how we would use a function to create this functionality: +If a user e.g. click on a button indicating that the user only wants listings that are of the type farm. Lets try and imagine how we would use a function to create this functionality: ```js const listings = generateListings(20); diff --git a/legacy/javascript/javascript2/week2/optional-homework.md b/legacy/javascript/javascript2/week2/optional-homework.md index 648cb28c..22d25949 100644 --- a/legacy/javascript/javascript2/week2/optional-homework.md +++ b/legacy/javascript/javascript2/week2/optional-homework.md @@ -72,9 +72,9 @@ Copy the movies array in the [movies](optional-homework/movies.js) file. Use thi 4. Create a new array that has an **extra key called tag**. The tag is based on the rating: Good (>= 7), Average (>= 4 and < 7), Bad (< 4) 5. **Using [chaining](readme.md#chaining)**, first filter the movies array to only contain the movies rated higher than 6. Now map the movies array to only the rating of the movies. 6. **Count the total number of movies** containing any of following keywords: `Surfer`, `Alien` or `Benjamin`. So if there were 3 movies that contained `Surfer`, 1 with `Alien` and 2 with `Benjamin`, you would return 6. Can you make sure the search is case insensitive? -7. Create an array of movies where a **word in the title is duplicated**. Fx "Star **Wars**: The Clone **Wars**" the word **Wars** is duplicated. Here are some madeup examples of movies with duplicated words in the title: "**The** three men and **the** pistol", "**Chase** three - The final **chase**" +7. Create an array of movies where a **word in the title is duplicated**. e.g. "Star **Wars**: The Clone **Wars**" the word **Wars** is duplicated. Here are some madeup examples of movies with duplicated words in the title: "**The** three men and **the** pistol", "**Chase** three - The final **chase**" 8. Calculate the **average rating** of all the movies using [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce). _Optional_ -9. **Count the total number** of Good, Average and Bad movies using [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce). A return could fx be `{goodMovies: 33, averageMovies: 45, goodMovies: 123}` _Optional_ +9. **Count the total number** of Good, Average and Bad movies using [reduce](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce). A return could e.g. be `{goodMovies: 33, averageMovies: 45, goodMovies: 123}` _Optional_ ## 2. hyfBay - get the okay'est products here - continued @@ -86,7 +86,7 @@ A very normal usecase for a product site is that a **user wants to search for so BUT first lets figure out what happens on a conceptual level, when a user filters some products: -1. Some kind of **event happens**, fx a user searches for a product, we need to listen for that event +1. Some kind of **event happens**, e.g. a user searches for a product, we need to listen for that event 2. When that event happens we need to **filter the products** the user wants 3. Then we should **render those products** @@ -128,6 +128,6 @@ No matter how small or how big. Create some feature that would be **cool/helpful ### 2.6 Sort the products - _optional_ -This task is more open ended! So you need to come up with fx how the user should interact with the functionality. +This task is more open ended! So you need to come up with e.g. how the user should interact with the functionality. -Give the user the possibility to sort the products. That could fx be on price, name, rating or all of the above! +Give the user the possibility to sort the products. That could e.g. be on price, name, rating or all of the above! diff --git a/legacy/javascript/javascript2/week3/README.md b/legacy/javascript/javascript2/week3/README.md index 3e555194..acc663fa 100644 --- a/legacy/javascript/javascript2/week3/README.md +++ b/legacy/javascript/javascript2/week3/README.md @@ -44,7 +44,7 @@ Here is the analogy in a quick writeup: There is a a man called mr. X. You can call him with any problem and he will answer your right away. He picks up the phone and answers RIGHT away. This is like synchronous js code. It runs right away, no waiting. -Now mr. X gets lots of calls. Therefore he hires a person to take his calls. This guy passes on a message to mr x once he is completely free. So now when you call mr. X you leave his assistant a message and then wait for his assistant to call back. Once Mr x is done with all his other calls his assistant calls you back with mr x's answer. This is like asynchronous js code. We now have to wait for our answer. You ask for some task to get done with a callback function, fx log "hello" after one second. Once one second has elapsed javascript runs your callback function. +Now mr. X gets lots of calls. Therefore he hires a person to take his calls. This guy passes on a message to mr x once he is completely free. So now when you call mr. X you leave his assistant a message and then wait for his assistant to call back. Once Mr x is done with all his other calls his assistant calls you back with mr x's answer. This is like asynchronous js code. We now have to wait for our answer. You ask for some task to get done with a callback function, e.g. log "hello" after one second. Once one second has elapsed javascript runs your callback function. ### Synchronous diff --git a/legacy/javascript/javascript2/week3/lesson-plan.md b/legacy/javascript/javascript2/week3/lesson-plan.md index 35bde4ed..023e0ce5 100644 --- a/legacy/javascript/javascript2/week3/lesson-plan.md +++ b/legacy/javascript/javascript2/week3/lesson-plan.md @@ -13,13 +13,13 @@ These are some examples of previously created materials by mentors that you can Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!! - Function as a variable - function can be called inside another function, like we saw with the home-made `forEach` - [Code inspiration](#calling-a-function-within-a-function) -- Callback function and asynchronicity - shows a practical example of function that gets called by another function (fx `setTimeout` or `addEventListener`) +- Callback function and asynchronicity - shows a practical example of function that gets called by another function (e.g. `setTimeout` or `addEventListener`) - [Code inspiration](#callback-functions) - Anonymous function vs named function - [Code inspiration](#anonymous-vs-named-function) @@ -86,7 +86,7 @@ Events in javascript are thing like: A timer has just finished, a user clicked a button, our page has loaded, someone types into an input element or we have just gotten some data from a server. When these events happen, we usually want to add some functionality. -Fx when a user clicks the like button (event), we want to increment the like counter and color the like button blue. +For example, when a user clicks the like button (event), we want to increment the like counter and color the like button blue. Or when someone clicks "Close cookies" (event) we want to remove the cookie div. Lets first try to create some js that waits for 2 seconds and the console.logs out "2 seconds has elapsed!" In javascript we use an event listener to listen diff --git a/legacy/javascript/javascript2/week3/optional-homework.md b/legacy/javascript/javascript2/week3/optional-homework.md index 9367edfd..0f4ad96e 100644 --- a/legacy/javascript/javascript2/week3/optional-homework.md +++ b/legacy/javascript/javascript2/week3/optional-homework.md @@ -42,7 +42,7 @@ The warmup is a **little abstract**, it will get more concrete later on! ![second task](assets/log-location.gif) -6. _Optional_ Now show that location on a map using fx the [Google maps api](https://developers.google.com/maps/documentation/javascript/tutorial) +6. _Optional_ Now show that location on a map using e.g. the [Google maps api](https://developers.google.com/maps/documentation/javascript/tutorial) 7. Create a function called `runAfterDelay`. It has two parameters: `delay` and `callback`. When called the function should wait `delay` seconds and then call the provided callback function. Try and call this function with different delays and different callback functions @@ -80,7 +80,7 @@ You can implement it exactly like you want to, but here is my recommended order: 1. **Create an input and a button in html**. When the button is clicked, get the value of the input. This value will be the amount of time the game should run. 2. **Set a timeout for the time specified by the user.** After that time has run out just log out a simple string. -3. **Create an event listener** so you can call a function **when any key is pressed**. Now grab the actual key that was pressed. For example, was it a `j` or an `i`. We are interested in `s` and `l`. Here google is your friend! +3. **Create an event listener** so you can call a function **when any key is pressed**. Now grab the actual key that was pressed. e.g. was it a `j` or an `i`. We are interested in `s` and `l`. Here google is your friend! 4. **Keep a counter** for how many times `l` and `s` was pressed. 5. **Now put it all together!** After the timeout is done figure out which of the counters is largest. Give some kind of feedback to the users indicating who won. diff --git a/legacy/javascript/javascript3/week1/lesson-plan.md b/legacy/javascript/javascript3/week1/lesson-plan.md index bf9f61f4..a1bb26dc 100644 --- a/legacy/javascript/javascript3/week1/lesson-plan.md +++ b/legacy/javascript/javascript3/week1/lesson-plan.md @@ -13,7 +13,7 @@ These are some examples of previously created materials by mentors that you can Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!! @@ -142,7 +142,7 @@ Create a json file with two orders that contain at least these things: - Order id - Price - List of drinks -- Order extras (fx cheese, lettuce etc.) +- Order extras (e.g. cheese, lettuce etc.) Think about what what type the data should be saved as! diff --git a/legacy/javascript/javascript3/week1/optional-homework.md b/legacy/javascript/javascript3/week1/optional-homework.md index 9b6a4390..958201a3 100644 --- a/legacy/javascript/javascript3/week1/optional-homework.md +++ b/legacy/javascript/javascript3/week1/optional-homework.md @@ -19,11 +19,11 @@ If you struggle to do this weeks homework there are a couple of things to do: Create your own json file with something that **interests you**. Maybe that could be computers, pets, music etc. -Remember to validate the json using a tool like fx this: +Remember to validate the json using a tool like e.g. this: ## Find a cool api -Find a cool api and **explain how it works** and what kind of **json data** the api responds with. Is it an array, an object, a string. How is the data structure. Is it fx an array of objects or how is it structured. +Find a cool api and **explain how it works** and what kind of **json data** the api responds with. Is it an array, an object, a string. How is the data structure. Is it e.g. an array of objects or how is it structured. There are a few examples of apis here: diff --git a/legacy/javascript/javascript3/week2/lesson-plan.md b/legacy/javascript/javascript3/week2/lesson-plan.md index 584484aa..46b7afa4 100644 --- a/legacy/javascript/javascript3/week2/lesson-plan.md +++ b/legacy/javascript/javascript3/week2/lesson-plan.md @@ -13,7 +13,7 @@ These are some examples of previously created materials by mentors that you can Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!! @@ -60,7 +60,7 @@ At this point good coding practices is starting to get very important! Check our ### Async/await - simple usage ```js -// Warm up exercise. The students has to say everything they can about a variable, ONLY from the variable name. Fx the type, what it returns, what object we could expect etc. +// Warm up exercise. The students has to say everything they can about a variable, ONLY from the variable name. e.g. the type, what it returns, what object we could expect etc. // cars, car, title, getTitle, addTitle, isTitle, hasTitle, hasItem, users, year, yearIndex, user, review. ``` @@ -253,7 +253,7 @@ Using async await Using promises 1. `fetch` yes or no from this api: `https://yesno.wtf/api`. log out the answer -2. Try fetching a url that rejects fx `https://knajskdskj.jasdk`. Log out the error message +2. Try fetching a url that rejects e.g. `https://knajskdskj.jasdk`. Log out the error message ## Exercise 3 diff --git a/legacy/javascript/javascript3/week3/lesson-plan.md b/legacy/javascript/javascript3/week3/lesson-plan.md index a70372ba..5bb72587 100644 --- a/legacy/javascript/javascript3/week3/lesson-plan.md +++ b/legacy/javascript/javascript3/week3/lesson-plan.md @@ -13,7 +13,7 @@ These are some examples of previously created materials by mentors that you can Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!! diff --git a/legacy/nodejs/week1/lesson-plan.md b/legacy/nodejs/week1/lesson-plan.md index 5c29e1d5..6a6746b6 100644 --- a/legacy/nodejs/week1/lesson-plan.md +++ b/legacy/nodejs/week1/lesson-plan.md @@ -7,7 +7,7 @@ Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!! diff --git a/legacy/nodejs/week2/lesson-plan.md b/legacy/nodejs/week2/lesson-plan.md index 2410275b..e426674b 100644 --- a/legacy/nodejs/week2/lesson-plan.md +++ b/legacy/nodejs/week2/lesson-plan.md @@ -7,7 +7,7 @@ Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!! diff --git a/legacy/nodejs/week3/lesson-plan.md b/legacy/nodejs/week3/lesson-plan.md index 287cf3f5..972104b6 100644 --- a/legacy/nodejs/week3/lesson-plan.md +++ b/legacy/nodejs/week3/lesson-plan.md @@ -7,7 +7,7 @@ Remember to add the code you wrote in the class to the relevant class branch's class work folder. If the branch has not been created just create and push it :) If you don't have access, write to one from the core team. You can see an example below! -To find examples of what teachers have taught before go to the class branches in the classwork folder, Fx [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) +To find examples of what teachers have taught before go to the class branches in the classwork folder, e.g. [class 07](https://github.com/HackYourFuture-CPH/JavaScript/tree/class07/JavaScript1/Week1/classwork) If you find anything that could be improved then please create a pull request! We welcome changes, so please get involved if you have any ideas!!!