rearenged homework · ffarjad/JavaScript1@f79583a · GitHub
Skip to content

Commit f79583a

Browse files
committed
rearenged homework
1 parent fbf518a commit f79583a

6 files changed

Lines changed: 53 additions & 62 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions

Week6/README.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,22 @@ In week seven we will discuss the following topics:
77
• call
88
• apply
99
• bind
10-
• Code flow (order of execution)
11-
10+
• Promises
1211
```
1312

1413
### Here are resources that we like you to read as a preparation for the coming lecture:
1514

16-
#### Closures and async code
17-
- [Why closures are helpful with async code](http://stackoverflow.com/questions/13343340/calling-an-asynchronous-function-within-a-for-loop-in-javascript)
18-
1915
### `call` `apply`, `bind`
2016
- [Function.prototype.call()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call)
2117
- [Function.prototype.apply()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply)
2218
- [Function.prototype.bind()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind)
2319

24-
_Please go through the material and come to class prepared!_
25-
26-
27-
28-
29-
20+
#### Promises
21+
Some nice resources about promises :ring:
22+
- [Googles post about Promises](https://developers.google.com/web/fundamentals/getting-started/primers/promises)
23+
- [A nice article from David Walsh](https://davidwalsh.name/promises)
24+
- [A real life example](https://github.com/mdn/js-examples/blob/master/promises-test/index.html)
25+
- [stackoverflow]http://stackoverflow.com/questions/13343340/calling-an-asynchronous-function-within-a-for-loop-in-javascript
3026

27+
_Please go through the material and come to class prepared!_
3128

Week7/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@ In week eight we will discuss the following topics:
55
• Structure for a basic SPA
66
• XMLHttpRequests
77
• API calls
8-
• Async VS Sync
98
```
109

1110
### Here are resources that we like you to read as a preparation for the coming lecture:
1211

13-
#### Async VS Sync
14-
- Read about Asynchronous vs. Synchronous programming: http://www.hongkiat.com/blog/synchronous-asynchronous-javascript/
15-
1612
#### APIs
1713
- Read about APIS: https://www.programmableweb.com/api-university/what-are-apis-and-how-do-they-work
1814

Week8/MAKEME.md

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Topics discussed this week:
55
• Structure for a basic SPA
66
• XMLHttpRequests
77
• API calls
8-
• Async VS Sync
98
```
109

1110

@@ -25,41 +24,7 @@ _Deadline Saturday_
2524

2625
:point_up:
2726

28-
## Step 3: Async challenge
29-
30-
_Deadline Saturday_
31-
32-
1. Rewrite the code below to Async:
33-
34-
```js
35-
1.
36-
37-
let sum = calculateSum(2, 6);
38-
console.log(sum);
39-
40-
2.
41-
42-
let results = $.getJSON('http://myapi.com');
43-
showResults(results);
44-
45-
3.
46-
47-
let sum = calculateSum(2, 6);
48-
if (sum > 8) {
49-
console.log('larger than 8');
50-
}
51-
52-
4.
53-
54-
let data = $.getJSON('http://myapi.com');
55-
data = data.map(function (x) { return x * 8; });
56-
57-
writeDataToFile(data);
58-
```
59-
60-
61-
62-
## Step 4: SPA :sweat_drops:
27+
## Step 3: SPA :sweat_drops:
6328

6429
_Deadline Saturday_
6530

Week8/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
```
44
In week nine we will discuss the following topics:
55
• (re)writing data structures (in JSON)
6-
• Promises
6+
• Async VS Sync
7+
• Code flow (order of execution)
78
```
89

910
### Here are resources that we like you to read as a preparation for the coming lecture:
1011

11-
#### Promises
12-
Some nice resources about promises :ring:
13-
- [Googles post about Promises](https://developers.google.com/web/fundamentals/getting-started/primers/promises)
14-
- [A nice article from David Walsh](https://davidwalsh.name/promises)
15-
- [A real life example](https://github.com/mdn/js-examples/blob/master/promises-test/index.html)
16-
- [stackoverflow]http://stackoverflow.com/questions/13343340/calling-an-asynchronous-function-within-a-for-loop-in-javascript
12+
#### Async VS Sync
13+
- Read about Asynchronous vs. Synchronous programming: http://www.hongkiat.com/blog/synchronous-asynchronous-javascript/
14+
15+
#### Closures and async code
16+
- [Why closures are helpful with async code](http://stackoverflow.com/questions/13343340/calling-an-asynchronous-function-within-a-for-loop-in-javascript)
1717

1818
_Please go through the material and come to class prepared!_
1919

Week9/MAKEME.md

Lines changed: 35 additions & 2 deletions

0 commit comments

Comments
 (0)