You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Week6/MAKEME.md
+17-13Lines changed: 17 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,11 @@ _Deadline Monday_
15
15
16
16
Give feedback on `step 2` of `week 5` to one of your fellow students (do this by creating issues in Github).
17
17
18
-
## Step 2: Git Homework
18
+
## ~~Step 2: Git Homework~~
19
19
20
-
_Deadline Saturday_
20
+
~~_Deadline Saturday_~~
21
21
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).~~
23
23
24
24
## Step 3: Read
25
25
@@ -36,6 +36,17 @@ _Deadline Saturday_
36
36
37
37
_Deadline Wednesday_
38
38
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
+
functiondoIt() {
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
+
39
50
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.
40
51
41
52
```js
@@ -46,22 +57,15 @@ function foo(func) {
46
57
functionbar() {
47
58
console.log('Hello, I am bar!');
48
59
}
60
+
61
+
foo(bar);
49
62
```
50
63
51
-
foo(bar);
52
64
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:
54
65
55
-
```js
56
-
functiondoIt() {
57
-
console.log('I am done');
58
-
}
59
-
setTimeout(doIt, 5000)
60
-
```
61
66
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`)
63
67
64
-
You must write a function that takes 4 arguments.
68
+
2\.You must write a function that takes 4 arguments.
65
69
- A start value
66
70
- An end value
67
71
- A callback to call if the number is divisible by 3
0 commit comments