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

Skip to content

Commit 5ff6907

Browse files
authored
Merge pull request HackYourFuture#32 from remarcmij/master
OOP fundamental
2 parents 402134f + 09c04ff commit 5ff6907

File tree

7 files changed

+478
-21
lines changed

7 files changed

+478
-21
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Here you can find course content and homework for the JavaScript 1,2 and 3 modul
1313
|4.|• Capturing user input <br>• Events<br>• [Basic DOM manipulations (img src, innerHTML)](fundamentals/DOM_manipulation.md)<br>• Code debugging using the browser <br>• [Code commenting](fundamentals/code_commenting.md)<br>• Structuring code files<br>• [Code formatting](fundamentals/code_formatting.md) |[Reading Week 4](/Week4/README.md)|[Homework Week 4](/Week4/MAKEME.md)|
1414
|5.|• Functions + JSON/Arrays<br>• [Array Manipulations](fundamentals/array_manipulation.md)<br>• JSON<br>• [Map and filter](fundamentals/map_filter.md)<br>• Arrow functions |[Reading Week 5](/Week5/README.md)|[Homework Week 5](/Week5/MAKEME.md)|
1515
|6.|[Closures](fundamentals/scope_closures_this.md) <br>• Callbacks|[Reading Week 6](/Week6/README.md)|[Homework Week 6](/Week6/MAKEME.md)|
16-
|7.|• Object Oriented Programming <br>• [Promises](fundamentals/promises.md)|[Reading Week 7](/Week7/README.md)|[Homework Week 7](/Week7/MAKEME.md)|
16+
|7.|[Object Oriented Programming and Classes](fundamentals/oop_classes.md)<br>• [The `this` keyword](fundamentals/this.md) |[Reading Week 7](/Week7/README.md)|[Homework Week 7](/Week7/MAKEME.md)|
1717
|8.|• Structure for a basic SPA (Single Page Application) <br>• [XMLHttpRequests](fundamentals/XMLHttpRequest.md) <br>• API calls|[Reading Week 8](/Week8/README.md)|[Homework Week 8](/Week8/MAKEME.md)|
18-
|9.|(re)writing data structures (in JSON) <br>• Async vs Sync • Code flow (order of execution) |[Reading Week 9](/Week9/README.md)|[Homework Week 9](/Week9/MAKEME.md)|
18+
|9.|[Promises](fundamentals/promises.md)<br> • (re)writing data structures (in JSON) <br>• Async vs Sync <br>• Code flow (order of execution) |[Reading Week 9](/Week9/README.md)|[Homework Week 9](/Week9/MAKEME.md)|
1919

2020
__Kind note:__
2121

VSCodeTips/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,14 @@ We recommend that you apply two changes to the default settings of VSCode to hel
5050
![settings-btn](assets/settings.png)
5151

5252
2. From the menu, select **Settings**.
53-
3. In the `USER SETTINGS` tab in the right-hand half of the screen add the two lines indicated below between the curly braces:
53+
3. In the `USER SETTINGS` tab in the right-hand half of the screen add the three lines indicated below between the curly braces:
5454

5555
```json
5656
/// Place your settings in this file to overwrite the default settings
5757
{
5858
"editor.formatOnType": true,
59-
"editor.formatOnPaste": true
59+
"editor.formatOnPaste": true,
60+
"editor.formatOnSave": true
6061
}
6162
```
6263

Week6/MAKEME.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ _Deadline Monday_
1515

1616
Give feedback on `step 2` of `week 5` to one of your fellow students (do this by creating issues in Github).
1717

18-
## Step 2: Git Homework
18+
## ~~Step 2: Git Homework~~
1919

20-
_Deadline Saturday_
20+
~~_Deadline Saturday_~~
2121

22-
[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).
22+
~~[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).~~
2323

2424
## Step 3: Read
2525

@@ -36,6 +36,17 @@ _Deadline Saturday_
3636

3737
_Deadline Wednesday_
3838

39+
0\. We learned a little bit about callbacks in JS. A callback is simply a function passed to another function that gets executed (run) after a potentially long running operation has completed. There is another function called `setTimeout` that will wait a specified period of time and then execute a function. For example:
40+
41+
```js
42+
function doIt() {
43+
console.log('I am done');
44+
}
45+
setTimeout(doIt, 5000)
46+
```
47+
48+
>f you run the above code it will wait 5 seconds and print `I am done`. Please read something about setTimeout on MDN. The first argument to the `setTimeout` call is the callback (`doIt`)
49+
3950
1\.We saw that we can pass functions as arguments to other functions. Your task is to write a function that takes another function as an argument and runs it.
4051

4152
```js
@@ -46,22 +57,15 @@ function foo(func) {
4657
function bar() {
4758
console.log('Hello, I am bar!');
4859
}
60+
61+
foo(bar);
4962
```
5063

51-
foo(bar);
5264

53-
2\.We learned a little bit about callbacks in JS. A callback is simply a function passed to another function that gets executed (run) after a potentially long running operation has completed. There is another function called `setTimeout` that will wait a specified period of time and then execute a function. For example:
5465

55-
```js
56-
function doIt() {
57-
console.log('I am done');
58-
}
59-
setTimeout(doIt, 5000)
60-
```
6166

62-
If you run the above code it will wait 5 seconds and print `I am done`. Please read something about setTimeout on MDN. The first argument to the `setTimeout` call is the callback (`doIt`)
6367

64-
You must write a function that takes 4 arguments.
68+
2\. You must write a function that takes 4 arguments.
6569
- A start value
6670
- An end value
6771
- A callback to call if the number is divisible by 3

fundamentals/assets/prototype.png

63.3 KB
Loading

fundamentals/map_filter.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ accumulator = reducerFn(accumulator, this[i]);
130130

131131
From this line we can define the reducer function as a function that takes an accumulator value and the current array element and returns a new accumulator value.
132132

133-
The whole process is visualised in the figure below (the term _bucket_ was used here to represent the accumulator).
134-
135-
![image](assets/reduce-bucket.png)
136-
137133
The **reduce()** method is the most flexible of the map/filter/reduce triplet. In fact, it is possible to rewrite **map()** and **filter** using **reduce()**.
138134

139135
### Using reduce() to filter

0 commit comments

Comments
 (0)