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

Skip to content

Commit b08bc72

Browse files
author
Noer Paanakker
committed
added interactive exercises/content for each week, more structure
1 parent 7f136c6 commit b08bc72

File tree

8 files changed

+222
-56
lines changed

8 files changed

+222
-56
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
> Please help us improve and share your feedback! If you find better tutorials
22
> or links, please share them by [opening a pull request](https://github.com/HackYourFuture/JavaScript3/pulls).
33
4-
# Module #4 - JavaScript 3: Advanced JavaScript and working with APIs (Frontend)
4+
# Module #4 - JavaScript 3: Object-Oriented Programming and working with APIs (Frontend)
55

66
![JavaScript3](./assets/javascript3.png)
77

8+
Welcome to JavaScript3! In this module you'll be learning about one of the core things of what makes a web developer: working with APIs!
9+
810
## Learning goals
911

1012
In order to successfully complete this module you will need to master the following:
@@ -28,11 +30,11 @@ If you have any questions or if something is not entirely clear ¯\\\_(ツ)\_/¯
2830

2931
## Planning
3032

31-
| Week | Topic | Reading Materials | Homework | Lesson Plan |
32-
| ---- | ------------------------------------------------------------------------ | ------------------------------ | ------------------------------- | -------------------------------------- |
33-
| 1. | Application Programming Interface (API), AJAX, jQuery | [Reading W1](/Week1/README.md) | [Homework W1](/Week1/MAKEME.md) | [Lesson Plan W1](/Week1/LESSONPLAN.md) |
34-
| 2. | Fetch API, Promises, JavaScript Versions, Thinking like a programmer III | [Reading W2](/Week2/README.md) | [Homework W2](/Week2/MAKEME.md) | [Lesson Plan W1](/Week1/LESSONPLAN.md) |
35-
| 3. | ES6 Classes, 'this' keyword, Async/await, Try...Catch, Arrow functions | [Reading W3](/Week3/README.md) | [Homework W3](/Week3/MAKEME.md) | [Lesson Plan W1](/Week1/LESSONPLAN.md) |
33+
| Week | Topic | Reading Materials | Homework | Lesson Plan |
34+
| ---- | -------------------------------------------------------------------------------------------------------- | ------------------------------ | ------------------------------- | -------------------------------------- |
35+
| 1. | Application Programming Interface (API), AJAX, jQuery | [Reading W1](/Week1/README.md) | [Homework W1](/Week1/MAKEME.md) | [Lesson Plan W1](/Week1/LESSONPLAN.md) |
36+
| 2. | Promises, Fetch API, JavaScript Versions, 'this' keyword, Arrow functions | [Reading W2](/Week2/README.md) | [Homework W2](/Week2/MAKEME.md) | [Lesson Plan W1](/Week1/LESSONPLAN.md) |
37+
| 3. | Object-Oriented Programming (OOP), ES6 Classes, Async/await, Try...Catch, Thinking like a programmer III | [Reading W3](/Week3/README.md) | [Homework W3](/Week3/MAKEME.md) | [Lesson Plan W1](/Week1/LESSONPLAN.md) |
3638

3739
## Finished?
3840

Week1/MAKEME.md

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
This week's concepts can be challenging, therefore let's get an easy introduction using some interactive exercises! Check the following resources out and start practicing:
1313

14-
- [Introduction to jQuery](https://www.codecademy.com/learn/learn-jquery)
14+
- [Learn JavaScript: Requests](https://www.codecademy.com/learn/introduction-to-javascript/modules/intermediate-javascript-requests)
1515

1616
## **2. JavaScript exercises**
1717

@@ -25,9 +25,9 @@ XHR, jQuery and fetch
2525

2626
Wouldn't it cool to make a new friend with just the click of a button?
2727

28-
Write a function that makes an aPI call to https://www.randomuser.me/api
28+
Write a function that makes an API call to https://www.randomuser.me/api
2929

30-
**Exercise 3: asdsa**
30+
**Exercise 3: **
3131
**Exercise 4: asdsa**
3232
**Exercise 5: asdsa**
3333

@@ -38,7 +38,6 @@ Now that you've learned about APIs and how to connect with them, let's apply it
3838
In the following two applications you'll be making API calls to two different services. In the first you'll make
3939

4040
- [Vanilla JS Numbers Facts App - AJAX & Fetch](https://www.youtube.com/watch?v=tUE2Nic21BA)
41-
- [Build a JavaScript & jQuery Movie Info App](https://www.youtube.com/watch?v=YsPqjYGauns)
4241

4342
## **4. PROJECT: Hack Your Repo I**
4443

@@ -81,12 +80,6 @@ The returned JSON data contains some basic information about each repository, su
8180

8281
The JSON data that is returned from the initial request to get repository information includes a property named `contributors_url`. Use the value of this property to fetch a list of contributors.
8382

84-
#### 1.2.3 GitHub API documentation
85-
86-
You can find detailed information about the GitHub API by means of the link listed below. However, the documentation is very extensive and not easy to digest. For this homework it is not necessary to study the GitHub API documentation. We provide the link here for completeness.
87-
88-
> GitHub API documentation: https://developer.github.com/v3/
89-
9083
### 1.3 Coding Style
9184

9285
In this homework we will be introducing a preferred coding style and supporting tools to help you write _"clean code"_. A number of popular [_JavaScript Style Guides_](https://codeburst.io/5-javascript-style-guides-including-airbnb-github-google-88cbc6b2b7aa) have recently emerged of which the one developed by [Airbnb](https://github.com/airbnb/javascript) has been chosen for this homework and is recommended for subsequent use during the HYF curriculum. It is documented here:
@@ -237,11 +230,9 @@ It should include the following components:
237230

238231
* To force a `404` network error so that you can test the rendering of errors, change the URL to make an invalid GitHub request, e.g. append an `x` to `orgs`: `orgsx`.
239232

240-
### 1.7 Handing in your homework
241-
242233
If necessary, review the instructions how to [Hand in homework](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/homework_pr.md) using GitHub pull request.
243234

244-
To test whether your code will be accepted when you submit your homework as a pull request you need to ensure that it does not contain ESLinr errors. Open a terminal window in VSCode and type the following command:
235+
To test whether your code will be accepted when you submit your homework as a pull request you need to ensure that it does not contain ESLint errors. Open a terminal window in VSCode and type the following command:
245236

246237
```
247238
npm test
@@ -267,12 +258,15 @@ If the answer is 'yes' to the preceding questions you are ready to follow these
267258

268259
---
269260

270-
_BONUS_ : Code Kata Race
261+
## **SUBMIT YOUR HOMEWORK!**
262+
263+
After you've finished your todo list it's time to show us what you got! The homework that needs to be submitted is the following:
271264

272-
- [Codewars](https://www.codewars.com/collections/hyf-homework-number-2)
265+
1. JavaScript exercises
266+
2. PROJECT: HackYourRepo I
273267

274-
## Step 2: Read before next lecture
268+
Upload both to your forked JavaScript3 repository in GitHub. Make a pull request to the original repository.
275269

276-
_Deadline Sunday morning_
270+
> Forgotten how to upload your homework? Go through the [guide](../hand-in-homework-guide.md) to learn how to do this again.
277271
278-
Go through the reading material in the [README.md](/Week2/README.md) to prepare for your next class.
272+
_Deadline Saturday 23.59 CET_

Week1/README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@ These are the topics for week 1:
1010
2. Asynchronous JavaScript and XML (AJAX)
1111
- JavaScript Object Notation (JSON)?
1212
- XMLHttpRequest (XHR)
13-
3. jQuery
13+
3. Axios
1414
- What's a module?
1515
- What's a library?
16-
- Using jQuery to make AJAX requests
16+
- Using Axios to make AJAX requests
1717

1818
## 1. Application Programming Interface (API)
1919

2020
Whenever we talk development we'll inevitably end up talking about Application Programming Interfaces, or APIs for short. But what is all the fuss about?
2121

22-
The first thing we need to understand is that API means different things to different people. Some people use it to refer to a complete application (frontend + backend), others use it to only refer to the server, or there's even people who use it to refer to any
22+
The first thing we need to understand is that API means different things to different people. Some people use it to refer to a complete application (frontend + backend), others use it to only refer to the server, or there's even people who use it to refer to any part of an application (i.e. "frontend API"/"server API")
2323

2424
For our purposes it's useful to stick to one definition, while keeping in mind that others will use it differently. Here's the definition we'll use:
2525

2626
```markdown
27-
An API is that part of the server that is open to requests from the client (whether it's a from a frontend or another server).
27+
An API is any software that contains a part that's accessible from an outside source: i.e. open to requests from the client (whether it's a from a frontend or another server). That part that's accessible is the "interface" of that software.
2828
```
2929

30-
You can think of an API in the following manner: Imagine you want to rent out a room in your house through Airbnb. Everyone who has a key to this room can freely enter and make use of whatever is inside.
30+
You can think of an API in the following manner: Imagine you want to rent out a room in your house through Airbnb. Everyone who has a key to this room can freely enter and make use of whatever is inside. In this analogy the house is the API, while the room that's rented out is the "interface".
3131

3232
For more research, check out the following resources:
3333

@@ -43,7 +43,7 @@ Conversely, there are also **private** APIs: software companies that grant acces
4343

4444
In reality, there are way more private than public APIs. This is because it's usually in the company's best interest to keep their code base hidden from the public eye: it would be like giving your secret recipe away for nothing.
4545

46-
Understand this fundamental truth: programming is a means to serving a business end. In this course you're learning how to program, to make nice-looking functional applications. However, this is always done within a business context. This is to say: does this software lead to making more money?
46+
Understand this fundamental truth: **programming is a means to serving a business end**. In this course you're learning how to program, to make nice-looking functional applications. However, this is always done within a business context. This is to say: does this software lead to making more money/gaining more popularity/or the achievement of any other business goal?
4747

4848
- [The Business Impact of Private, Partner and Public APIs](https://www.youtube.com/watch?v=Bk50AYGvs-g)
4949

@@ -73,15 +73,15 @@ The name AJAX is actually a misnomer, because XML isn't really used any more. In
7373

7474
In AJAX we make a client request to a web server, that in response sends us back information to be used in the frontend. Generally speaking, this data will be send in `JSON` format.
7575

76-
So, technically speaking, the term would actually be AJAJ
76+
So, technically speaking, the term would actually be AJAJ. However, the industry has decided to stick with the term AJAX to refer to these processes.
7777

7878
- [JSON Crash Course](https://www.youtube.com/watch?v=wI1CWzNtE-M)
7979

8080
### XMLHttpRequests (XHR)
8181

8282
In order to make an AJAX request we have to make use of a special type of object, called `XMLHttpRequest`(shortened to XHR). It's an object predefined for us by the `window` object in the browser.
8383

84-
> The `window` object is the most top-level object available to us in the browser. It contains the `document`, which contains all the HTML/CSS and JavaScript we write. Besides this, the `window` also contains a lot of other things we use when writing frontend code: `setTimeout()`, alert() and it even contains a reference to the `console` (from which we get `console.log()`). Try it out in the console if you want to see for yourself!
84+
> The `window` object is the most top-level object available to us in the browser. It contains the `document`, which contains all the HTML/CSS and JavaScript we write. Besides this, the `window` also contains a lot of other things we use when writing frontend code: `setTimeout()`, `alert()` and it even contains a reference to the `console` (from which we get `console.log()`). Try it out in the console if you want to see for yourself!
8585
8686
By creating a new instance of this object we can start making AJAX requests!
8787

@@ -94,7 +94,7 @@ Check the following resources to learn more about XHR.
9494
- [XMLHttpRequest](https://github.com/hackyourfuture/fundamentals/blob/master/fundamentals/XMLHttpRequest.md)
9595
- [AJAX Crash Course](https://www.youtube.com/watch?v=82hnvUYY6QA)
9696

97-
## 3. jQuery
97+
## 3. Axios
9898

9999
### What's a module?
100100

@@ -116,17 +116,15 @@ For more information about this, go through the following:
116116

117117
If you've ever written code you know how easy it is to duplicate it: you just copy and paste it.
118118

119-
Modules are small blocks of code that introduce a . If you were to add more code and the code base could really solve a particular problem?
119+
Modules are small blocks of code that make up a functionality. But what if you have a bunch of modules that aklsdnl;asndkl;ansl;dnal;ksnd
120+
121+
If you were to add more code and the code base could really solve a particular problem?
120122

121123
A `library` is a set of code that a developer (or several developers) has written in order to solve a specific problem within an application. This could be, for example, how to easier select items from the DOM, how to handle [data validation](https://www.techopedia.com/definition/10283/data-validation) or how to more easily create a [Single Page Application](https://en.wikipedia.org/wiki/Single-page_application).
122124

123125
At it's most fundamental level it means that others have written functions and other logical processes to make development quicker and easier. If they have published their code, through [npmjs.com](https://www.npmjs.com/) for example, you can legally make use of it in your own code. Almost all applications out there, no matter what language they're written in, contain at least a couple of libraries.
124126

125-
### Using jQuery to make AJAX requests
126-
127-
One of the most well-known and often used libraries in JavaScript is called `jQuery`. It's a library that was designed to make DOM manipulation, as well as event handling, CSS animation and AJAX operations much easier to perform.
128-
129-
- [jQuery Crash Course Playlist](https://www.youtube.com/playlist?list=PLillGF-RfqbYJVXBgZ_nA7FTAAEpp_IAc)
127+
### Using Axios to make AJAX requests
130128

131129
## Finished?
132130

Week2/MAKEME.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
## **1. Practice the concepts**
1111

12+
- [Learn JavaScript: Promises](https://www.codecademy.com/learn/introduction-to-javascript/modules/javascript-promises)
13+
1214
## **2. JavaScript exercises**
1315

1416
## **3. Code along**
@@ -19,7 +21,7 @@
1921

2022
The homework for week 2 will build on the work you did in week 1. You will create a new branch based on the `week1` branch.
2123

22-
1. Make sure that you committed all changes in the week 1 version of your homework.
24+
1. Make sure you are on the `week1` branch
2325
2. Create a new `week2` branch:
2426

2527
```

Week2/README.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,24 @@ These are the topics for week 2:
77
1. JavaScript Versions
88
2. Promises
99
- Callback Hell
10-
- ES6 Update
11-
3. Fetch API
12-
4. Thinking Like a Programmer III
10+
3. Arrow functions
11+
- 'this' keyword
12+
4. Fetch API
13+
5. Thinking Like a Programmer III
1314

1415
## 1. JavaScript Versions
1516

16-
You are undoubtably different than when you were a baby. Back then you couldn't really do much: crying, laughing and taking dumps. That's pretty much it. But as the years past you increasingly could do more and more: walking, socializing or playing an instrument.
17+
You are undoubtably different than when you were a baby. Back then you couldn't really do much: crying, laughing and taking dumps. That's pretty much it. But as the years pass you increasingly could do more and more: walking, socializing or playing an instrument.
1718

18-
Likewise, so has JavaScript evolved. Back in
19+
Likewise, so has JavaScript evolved. Throughout the course you have, unknowingly, used syntax from different JavaScript versions. For example, if you've ever declared a function like this:
1920

21+
```js
22+
function aFunction() {
23+
// Some magnificent code ...
24+
}
25+
```
26+
27+
- [The History of JavaScript | Why is JavaScript also called ECMAScript?](https://www.youtube.com/watch?v=JpwxjkpZfhY)
2028
- [The Weird History of JavaScript](https://www.youtube.com/watch?v=Sh6lK57Cuk4)
2129

2230
## 2. Promises
@@ -25,26 +33,35 @@ Likewise, so has JavaScript evolved. Back in
2533

2634
By now you should've had some practice using callbacks. To reiterate, we use callbacks **as a way to create asynchronicity** in our application: we want to enable our application to do multiple things simultaneously.
2735

28-
But what if you want to have multiple
36+
But what if you want to have callbacks within callbacks... within callbacks? This will lead to what is known as **callback hell**.
2937

3038
- [Callback Hell](http://callbackhell.com/)
3139

3240
This is where Promises come in. The concept of a Promise, in execution, doesn't add anything new. It does exactly what callbacks aim to do, which is enabling asynchronous actions: for example, clicking a button to load in an image, while still being able to navigate the webpage.
3341

34-
What
42+
What a Promise does is make writing callbacks more readable for you, the developer. This is its main benefit. In effect, you could call Promises the updated version of callbacks. Callbacks version 2.0.
3543

36-
So, in effect, you could call Promises the updated version of callbacks. Callbacks version 2.0.
44+
Go through the following resources to learn more about Promises:
3745

46+
- [Let's learn ES6 - Promises](https://www.youtube.com/watch?v=vQ3MoXnKfuQ)
3847
- [A Simple Guide to ES6 Promises](https://codeburst.io/a-simple-guide-to-es6-promises-d71bacd2e13a)
3948
- [Promises](https://www.github.com/hackyourfuture/fundamentals/blob/master/fundamentals/promises.md)
4049

41-
## 3. Fetch API
50+
## 3. Arrow functions
4251

43-
Last week you learned about making API calls. For repetition's sake
52+
One of a programmer's favorite things to do is to write clean and concise code. Arrow functions are a new way within
4453

45-
- [Fetch() - Working with Data and APIs in JavaScript](https://www.youtube.com/watch?v=tc8DU14qX6I)
54+
- [Let's learn ES6 - Arrow functions](https://www.youtube.com/watch?v=oTRujqZYhrU)
55+
56+
## 4. Fetch API
57+
58+
Last week you learned about making API calls. You learned how to do this using the XHR object, which we can access through the browser's `window` object.
4659

47-
## 4. Thinking Like a Programmer III
60+
As we've learned in the previous sections, JavaScript as a language evolves. But so do browsers!
61+
62+
It's a modern way to make API calls. It incorporates Promises. A `fetch` function is now provided in the global `window` scope in the browser. You can check it out by opening your developers tools and searching for `fetch`.
63+
64+
- [Fetch() - Working with Data and APIs in JavaScript](https://www.youtube.com/watch?v=tc8DU14qX6I)
4865

4966
## Finished?
5067

Week3/MAKEME.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
## **1. Practice the concepts**
1111

12+
- [Learn JavaScript: Objects](https://www.codecademy.com/learn/introduction-to-javascript/modules/learn-javascript-objects)
13+
- [Learn JavaScript: Classes](https://www.codecademy.com/learn/introduction-to-javascript/modules/learn-javascript-classes)
14+
- [Learn JavaScript: Async/Await](https://www.codecademy.com/learn/introduction-to-javascript/modules/asynch-js)
15+
1216
## **2. JavaScript exercises**
1317

1418
## **3. Code along**
@@ -20,12 +24,10 @@
2024
This week you will work with all JavaScript files in the `src` folder. The assignment consists of two parts:
2125

2226
1. Refactor all `.then()` and `.catch()` methods with `async`/`await` and `try...catch`.
23-
2. Refactor your application to use ES6 classes.
27+
2. Refactor your application to use `ES6 classes`.
2428

2529
#### 2.2.2 ES6 Classes
2630

27-
**_Deadline Saturday_**
28-
2931
This final assignment requires you to go the extra mile and master Object Oriented Programming and ES6 classes.
3032

3133
In this assignment you need to redistribute and adapt the code from `index.js` to the files `App.js`, `Repository.js` and `Contributor.js`. You do not need to modify `Util.js`.

0 commit comments

Comments
 (0)