Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6e9503f

Browse files
committed
fixed homework class13
1 parent 669c39e commit 6e9503f

File tree

9 files changed

+103
-135
lines changed

9 files changed

+103
-135
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Here you can find course content and homework for the JavaScript 1,2 and 3 modul
99
|0.|Preparation for your first JavaScript session|[Pre-reading](/Week0/README.md) + [CLI Reading Week 1](https://github.com/HackYourFuture/CommandLine/blob/master/Lecture-1.md)|-|-|
1010
|1.|Git Session with Unmesh|[Reading Week 1](/Week1/README.md) | [Homework Week 1](/Week1/MAKEME.md)|[Review](/Week1/REVIEW.md)|
1111
|2.|• Intro JavaScript (What is it, where can you use it for)<br>• Variables [var, let, const]<br>• Basic Data types [Strings, Numbers, Arrays, Booleans]<br>• Operators <br>• Naming conventions|[Reading Week 2](/Week2/README.md)|[Homework Week 2](/Week2/MAKEME.md)|[Review](/master/Week2/REVIEW.md)|
12-
|3.|• Git work flow :smiling_imp:<br>• Advanced data types [Objects] <br>• Conditions <br>• Statements vs Expressions<br> • Loops (for/while)<br>• Functions |[Reading Week 2](/Week2/README.md)|[Homework Week 2](/Week2/MAKEME.md)|[Review](/Week2/REVIEW.md)|
13-
|4.|• Capturing user input <br>• Basic DOM manipulations[img src, innerHTML] <br>• Code debugging using the browser <br>• Code commenting <br>• Structuring code files |[Reading Week 4](/Week4/README.md)|[JS](/Week4/MAKEME.md)|Review|
12+
|3.|• Git work flow :smiling_imp:<br>• Advanced data types [Objects] <br>• Conditions <br>• Statements vs Expressions<br> • Loops (for/while)<br>• Functions |[Reading Week 3](/Week3/README.md)|[Homework Week 3](/Week3/MAKEME.md)|[Review](/Week3/REVIEW.md)|
13+
|4.|• Capturing user input <br>• Basic DOM manipulations[img src, innerHTML] <br>• Code debugging using the browser <br>• Code commenting <br>• Structuring code files |[Reading Week 4](/Week4/README.md)|[Homework Week 4](/Week4/MAKEME.md)|Review|
1414
|5.|• Functions + JSON/Arrays<br>• Array Manipulations<br>• JSON<br>• Map and filter<br>• Arrow functions |[Reading Week 5](/Week5/README.md)|[Homework Week 5](/Week5/MAKEME.md)|[Review](/Week5/REVIEW.MD)|
1515
|6.|• Closures <br>• Scope <br>• Events <br>• Callbacks|[Reading Week 6](/Week6/README.md)|[Homework Week 6](/Week6/MAKEME.md)|[Review](/Week6/REVIEW.md)|
1616
|7.|• Object Oriented Programming <br>• Code flow (order of execution) <br>• Async VS Sync|[Reading Week 7](/Week7/README.md)|[Homework Week 7](/Week7/MAKEME.md)|[Review](/Week7/REVIEW.md)|

Week1/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ In week two we will discuss the following topics:
1414
To test that it was installed and running properly, go to your terminal and run the command: node -v You should get the node version printed on your terminal, for example, v8.8.0
1515
2. Although you are free to make you own choice of text/code editor to use during class and homework, we have good experiences with Microsoft's free VSCode editor, which is supported on Windows, Mac and Linux. Please refer to our [VSCode Tips](../VSCodeTips/README.md) for more information.
1616

17-
### Here are resources that we like you to read as a preparation for the coming lecture:
17+
## Here are resources that we like you to read as a preparation for the coming lecture:
1818

1919
Please watch the following parts of the course, [Programming Foundations Fundamentals](https://www.lynda.com/Programming-Foundations-tutorials/Welcome/83603/90426-4.html) on Lynda.com (if you don't have access to Lynda yet ask Gijs):
2020

@@ -31,7 +31,7 @@ Only watch the below chapters:
3131

3232
- Helpful resource: http://jsbooks.revolunet.com/ (here you can find tons of free JavaScript books online)
3333

34-
:star: You can also already go through the [review](https://github.com/HackYourFuture/JavaScript/blob/master/Week1/REVIEW.md) of the upcoming lecture.
34+
:star: You can also already go through the [review](/Week2/REVIEW.md) of the upcoming lecture. :star:
3535

3636
_Please go through the material and come to class prepared!_
3737

Week2/MAKEME.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ console.log('I'm awesome');
9393
5\.5 So now we have `z` and `a` find a way to compare the two values and store the highest of the two in a new variable.
9494
5\.6 Console.log the highest value.
9595

96-
6\. Arrays!
96+
6\. *Arrays!*
9797
6\.1 Declare an empty array (you can decide on how to call it yourself, but read on a bit here and see if you can find a good name that exactly describes what this variable will hold).
9898
6\.2 Write a console.log statement that explains in words what you think the value of the array is.
9999
6\.3 Console.log your array.
@@ -102,7 +102,7 @@ console.log('I'm awesome');
102102
6\.6 Add a statement that adds Daan's favorite animal (baby pig) to the *existing array*.
103103
6\.7 Log your new array!
104104

105-
7\. More strings
105+
7\. *More strings*
106106
7\.1 Let's consider the following string: `let myString = "this,is,a,test"`.
107107
7\.2 Add the string to your file and console.log it.
108108
7\.3 Find a way to get the length of `myString`.
@@ -140,13 +140,13 @@ if () {
140140
10\.2 Can you compare infinities? (Not in Eyad's world) - does 6/0 === 10/0? How can you test this?
141141
10\.3 Add console.log statements to the above program's in which you show that you understand the concepts (just like you've done in the above assignments).
142142

143-
### Step 4: **Some freeCodeCamp challenges (10 hours):**
143+
## Step 4: **Some freeCodeCamp challenges (10 hours):**
144144

145145
_Deadline Saturday_
146146

147147
On freeCodeCamp.com please do the [Basic JavaScript](https://www.freecodecamp.com/challenges/learn-how-free-code-camp-works) exercises up and until the __"Shopping List"__ exercise (there are some topics we did not cover but you can do it).
148148

149-
### Step 5: Read before next lecture
149+
## Step 5: Read before next lecture
150150

151151
_Deadline Sunday morning_
152152

Week2/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ Please watch the following parts of the course, [Programming Foundations Fundame
2020
<br>8. Collections
2121
<br>11. When Things Go Wrong
2222

23+
24+
## Read
2325
- [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/prototype)
26+
27+
## From the book _A Smarter Way To Learn JavaScript_ please read:
2428
- 'Loops' of [_A Smarter Way To Learn JavaScript_](https://github.com/Sharique-Hasan/SaylaniBatch2-JavaScript/blob/master/A%20Smarter%20Way%20to%20Learn%20JavaScript.pdf) : Chapters 18-20
2529
- 'Functions' of [_A Smarter Way To Learn JavaScript_](https://github.com/Sharique-Hasan/SaylaniBatch2-JavaScript/blob/master/A%20Smarter%20Way%20to%20Learn%20JavaScript.pdf) : Chapters 35 - 38
2630
- Functions ~ http://eloquentjavascript.net/03_functions.html

Week4/MAKEME.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,6 @@ _Deadline Sunday morning_
104104

105105
And just for fun ... https://www.freecodecamp.com/challenges/sum-all-numbers-in-a-range
106106

107-
108-
## Step 3: Some Challenges
109-
110-
_Deadline Saturday_
111-
112-
Let's practice working with Objects and Arrays. Go to FreeCodeCamp and complete all challenges under "Object Oriented and Functional Programming" and the _first four challenges_ under "Basic Algorithm Scripting", up until 'Find the longest word in a string.'
113-
114107
## Step 4: Read before next lecture
115108

116109
_Deadline Sunday morning_
@@ -131,9 +124,6 @@ Please note, there are various challenges all sorted on difficultly called KIU.
131124

132125
enjoy!
133126

134-
:star: Additional resources and review: [here](/Week3/REVIEW.md):star:
135-
136-
137127
:octocat:
138128
```
139129
How to hand in your homework:
@@ -143,3 +133,4 @@ How to hand in your homework:
143133
• Place the link to your repository folder in Trello.
144134
```
145135

136+
:star: Additional resources and review: [here](/Week3/REVIEW.md):star:

Week6/MAKEME.md

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -103,34 +103,6 @@ console.log(y);
103103
If you are confused please run the code and then consult the Google for "javaScript pass by value pass by reference"
104104
105105
106-
<!-- Write assignment with more fun API -->
107-
108-
## Step 4: Some more JavaScript
109-
110-
_Deadline Saturday_
111-
112-
Make a website that fetches (= to get) data asynchronously.
113-
114-
1) Create a new website with external js file
115-
116-
2) Add a button (e.g. 'click me') that when clicked `console.logs` 'you clicked me!'
117-
118-
3) Create a function that fetches from [The Github API](https://developer.github.com/v3/). For example from [this page] (https://api.github.com/orgs/HackYourFuture/repos) (the one we used last week). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript)
119-
120-
4) Display the data that you get from the Github API on your web page.
121-
122-
5) Now link the two together: When you click the button -> get the data from the Github API and display it on your website
123-
124-
6) Make all the repositories link their own page in Github. Use the value of the key: `name` to make this work (hint: Github urls always look like this https://api.github.com/repos/HackYourFuture/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`). Make sure the link opens in a new tab.
125-
126-
7) BONUS: if you look at this:
127-
128-
```js
129-
https://api.github.com/repos/HackYourFuture/CommandLine
130-
```
131-
132-
You can see `CommandLine` in the URL. These are called "query parameters" and let us specify in detail what we want from the API. Play around with this. For example you can make two buttons that either get data for a specific repository, JavaScript or Node.js. Or go even more crazy and make users type in a search box 'JavaScript' and then send that to the API by changing the repository.
133-
134106
__Bonus__: Write a function takes this array `['a', 'b', 'c', 'd', 'a', 'e', 'f', 'c']` and returns an array which only has unique values in it (so it removes the duplicate ones). Make it a 'smart' algorithm that could do it for every array (only strings/number). Try to make it as fast as possible!
135107
136108

Week7/MAKEME.md

Lines changed: 14 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -9,118 +9,68 @@ Topics discussed this week:
99

1010
>[Here](/Week7/README.md) you find the readings you have to complete before the eighth lecture.
1111
12-
13-
14-
1512
## Step 1: Give feedback on Step 3 and 4 of last weeks homework.
1613

1714
_Deadline Monday_
1815

1916
Give feedback on the SPA (Github API) and git branching homework of one of you fellow students. Please provide the feedback in an issue.
2017

21-
## Step 2: Git Homework
22-
23-
[Make these assignments](https://github.com/HackYourFuture/Git/blob/master/Lecture-3.md). For handing in homework follow the Forking workflow that is described in our lecture-3.md file of HackYourFuture’s Git repository (there is also a video that explains this).
24-
2518
## Step 3: Issues
26-
=======
27-
```
28-
Topics discussed this week:
29-
• Object Oriented Programming
30-
• Code flow (order of execution)
31-
• Async VS Sync
32-
```
33-
34-
>[Here](/Week7/README.md) you find the readings you have to complete before the eighth lecture.
35-
36-
## Step 1: Give feedback on Step 3 and 4 of last weeks homework.
37-
38-
Give feedback on the SPA (Github API) and git branching homework of one of you fellow students. Please provide the feedback in an issue.
39-
40-
## Step 2: Issues
41-
>>>>>>> planningClass12
4219

4320
- Solve all your Git issues. DO NO CLOSE AN ISSUE WITHOUT AN EXPLANATION OR CODE COMMIT REFERENCING THAT ISSUE.
4421

4522

46-
### Step 3: Fix issues and API
23+
## Step 3: Fix issues and API
4724

4825
- Fix the issues from the last week and make sure you explain how you fixed the issue in a comment (or commit message)
4926

27+
## Step 3: Some Challenges
28+
29+
_Deadline Saturday_
30+
31+
Let's practice working with Objects and Arrays. Go to FreeCodeCamp and complete all challenges under "Object Oriented and Functional Programming" and the _first four challenges_ under "Basic Algorithm Scripting", up until 'Find the longest word in a string.'
5032

51-
### Step 4: SPA :sweat_drops:
52-
You are going to write a SPA (Single Page Application) that uses the [Github API](https://developer.github.com/guides/getting-started/). Make sure that your app uses a logical pattern just like [this codepen](http://codepen.io/Razpudding/pen/MmVpeW).
33+
## Step 4: Some more JavaScript
5334

54-
Just like last week:
35+
_Deadline Saturday_
5536

5637
Make a website that fetches (= to get) data asynchronously.
5738

5839
1) Create a new website with external js file
5940

6041
2) Add a button (e.g. 'click me') that when clicked `console.logs` 'you clicked me!'
6142

62-
3) Create a function that fetches from [The Github API](https://developer.github.com/v3/). For example from [this page] (https://api.github.com/orgs/HackYourFuture/repos). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript)
43+
3) Create a function that fetches from [The Github API](https://developer.github.com/v3/). For example from [this page] (https://api.github.com/orgs/HackYourFuture/repos) (the one we used last week). For help on this check this [SO post](https://stackoverflow.com/questions/247483/http-get-request-in-javascript)
6344

6445
4) Display the data that you get from the Github API on your web page.
6546

6647
5) Now link the two together: When you click the button -> get the data from the Github API and display it on your website
6748

68-
Cool we are back where we left of.
49+
6) Make all the repositories link their own page in Github. Use the value of the key: `name` to make this work (hint: Github urls always look like this https://api.github.com/repos/HackYourFuture/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`). Make sure the link opens in a new tab.
6950

70-
6) Take a look at this:
51+
7) BONUS: if you look at this:
7152

7253
```js
7354
https://api.github.com/repos/HackYourFuture/CommandLine
7455
```
7556

76-
7) Make a function which takes a single argument. The function should make an XHR request to `https://api.github.com/repos/HackYourFuture/[SearchTerm]` where the search term will be the argument. This argument will be the input the user has given you, so make sure that when the user clicks the button you call this function with the argument.
77-
78-
8) Make all the repositories link their own page in Github. Use the value of the key: `name` to make this work (hint: Github urls always look like this https://api.github.com/repos/HackYourFuture/[repositoryName] where [repositoryName] would be replaced by the actual `name` of the repository, for example `CommandLine`). Make sure the link opens in a new tab.
79-
80-
- Make sure you handle user input well. That means you need to think about empty input, and input that doesn't yield any results.
81-
82-
So Github has this really nice documentation :octocat: :
83-
Check these out for example
84-
https://developer.github.com/v3/repos/collaborators/
85-
https://developer.github.com/v3/repos/commits/
86-
87-
9) Extend your page with an input element. This is so the user will be able to type in text.
57+
You can see `CommandLine` in the URL. These are called "query parameters" and let us specify in detail what we want from the API. Play around with this. For example you can make two buttons that either get data for a specific repository, JavaScript or Node.js. Or go even more crazy and make users type in a search box 'JavaScript' and then send that to the API by changing the repository.
8858

89-
10) For each repository, show (in the right column) who the contributers are. You will need to use the `contributors_url` for this.
9059

91-
!Important
92-
- Do not duplicate code! This is especially important for making requests since we are making multiple ones with different urls and we want to do different actions based on the call we are making. Here are some handles to get you started:
93-
- So write a function called `makeRequest` which accepts (at least) the following parameters: `url` and `callback`.
94-
- Make sure your `callback` is called when the request errors or when it sends a response (look at the documentation)
95-
- Your `callback` functions should accept two parameters so it can handle both errors: `err` and `response`.
96-
So based on your users actions (input, hovering, clicking) you want to call `makeRequest` with a different `url` and supply it with a function that handles both errors (display an error message to the user for example) and responses (render it correctly, as described below).
97-
- Make your functions small and reusable (modular)! That means create separate functions to handle certain steps.
98-
99-
11) GO WILD
100-
101-
Again, check out the Github API documentation to see what kind of magic stuff you can do with it.
102-
103-
The assignment is to implement something extra that is not in the assignment :scream: (nice and vague right?)
104-
105-
So for example, we have teams in our organization. You can find out who are in there and make a call to 'https://api.github.com/users/' + userInput (where userInput is a string typed into a search field by a user). You can show the users name, avatar image (not the link to the image!) and the number of public repos they have. Or you could make an API call to 'https://api.github.com/users/user/repos' to find out the public repo's they have. Or you can show how many people starred a specific repository.
106-
107-
Anyway, endless fun and possibilities. Need inspiration, check out the Github API documentation. Oh and please make it look nice (hint: use the stuff you learned in HTML/CSS)!
108-
109-
### Step 5: **Some freeCodeCamp challenges:**
60+
## Step 5: **Some freeCodeCamp challenges:**
11061

11162
1. [Comparisons with the Logical And Operator](https://www.freecodecamp.com/challenges/comparisons-with-the-logical-and-operator)
11263

11364
2. [Record Collection](https://www.freecodecamp.com/challenges/record-collection)
11465

11566
3. [Iterate over Arrays with map](https://www.freecodecamp.com/challenges/iterate-over-arrays-with-map)
11667

117-
### Step 6: Read before next lecture
68+
## Step 6: Read before next lecture
11869

11970
_Deadline Sunday morning_
12071

12172
Go trough the reading material in the [README.md](/Week7/README.md) to prepare for your next class
12273

123-
12474
_BONUS_ : Code Kata Race
12575

12676
If you haven't already join our clan: "Hack Your Future" in codewars

0 commit comments

Comments
 (0)