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: legacy/javascript/javascript2/week3/optional-homework.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ We want you to realise that **functions are just variables** in javascript. It i
11
11
12
12
## 1. Warmup
13
13
14
-
### 1.1 codewars!
14
+
### 1.1 CodeWars!
15
15
16
16
-[7 kyu Product Array (Array Series #5)](https://www.codewars.com/kata/5a905c2157c562994900009d/javascript)
17
17
@@ -54,7 +54,7 @@ The warmup is a **little abstract**, it will get more concrete later on!
54
54
55
55
## 2. Function as a variable
56
56
57
-
Create funtions that are used in these different ways:
57
+
Create functions that are used in these different ways:
58
58
59
59
- Create an array with 3 items. All items should be functions. Iterate through the array and call all the functions.
60
60
- Create a function as a const and try creating a function normally. Call both functions. Read up on this if you are interested: <https://stackoverflow.com/questions/1013385/what-is-the-difference-between-a-function-expression-vs-declaration-in-javascrip>
@@ -80,15 +80,15 @@ You can implement it exactly like you want to, but here is my recommended order:
80
80
81
81
1.**Create an input and a button in html**. When the button is clicked, get the value of the input. This value will be the amount of time the game should run.
82
82
2.**Set a timeout for the time specified by the user.** After that time has run out just log out a simple string.
83
-
3.**Create an event listener** so you can call a function **when any key is pressed**. Now grap the actual key that was pressed. Fx was it a `j` or an `i`. We are interested in `s` and `l`. Here google is your friend!
83
+
3.**Create an event listener** so you can call a function **when any key is pressed**. Now grab the actual key that was pressed. For example, was it a `j` or an `i`. We are interested in `s` and `l`. Here google is your friend!
84
84
4.**Keep a counter** for how many times `l` and `s` was pressed.
85
85
5.**Now put it all together!** After the timeout is done figure out which of the counters is largest. Give some kind of feedback to the users indicating who won.
86
86
87
87
### 2.1 Extra features
88
88
89
89
1.**Start a new game** functionality. Create some functionality so that the users can restart a game.
90
90
2. Try and give the site some **styling so it looks nice** :)
91
-
3.**Custom feature**. Add something unique to the game! If you dont know how to implement it, just describe what it should do!
91
+
3.**Custom feature**. Add something unique to the game! If you don't know how to implement it, just describe what it should do!
92
92
4.**Countdown to end of game** - _optional_. Have a countdown that simply counts down until the game is done.
0 commit comments