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
{{ message }}
This repository was archived by the owner on May 14, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+42-20Lines changed: 42 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,51 +11,73 @@ In this module you'll make a start into wonderful world of programming. We will
11
11
12
12
You'll be learning two main things:
13
13
14
-
1. Fundamental concepts in programming
15
-
While we're using JavaScript to illustrate these concepts, it's important to keep in mind that what you will learn is applicable to **any** programming language. They might differ in syntax (a fancy term for the arrangement of words in a language in order for it to make sense), but the functionality will be the same: a loop will always be a loop.
14
+
1.**Fundamental concepts in programming**. While we're using JavaScript to illustrate these concepts, it's important to keep in mind that what you will learn is applicable to **any** programming language. They might differ in syntax (a fancy term for the arrangement of words in a language in order for it to make sense), but the functionality will be the same: a loop will always be a loop.
16
15
17
-
This should be your mindset when you're learning concepts: **I'm learning how to become a software developer that can adjust to any language used, because I know what the underlying principles and concepts are**.
16
+
This should be your mindset when you're learning concepts: **I'm learning how to become a software developer that can adjust to any language used, because I know what the underlying principles and concepts are**.
18
17
19
-
2. How to think like a programmer
20
-
In one sentence this means: **knowing how to solve problems computationally**. Let's split that up in two parts: `how to solve problems` refers to the ability to identify issues and find effective solutions. `computationally` refers to the ability to think in logical steps that the computer can understand and execute.
18
+
2.**How to think like a programmer**. In one sentence this means: knowing how to solve problems using a computer. Let's split that up in two parts: `how to solve problems` refers to the ability to identify issues and find effective solutions. `computationally` refers to the ability to think in logical steps that the computer can understand and execute.
21
19
22
-
This should be your mindset when you're learning how to think : **I'm learning how to think in logical steps, identifying cause and effect, and always looking for solutions**.
20
+
This should be your mindset when you're learning how to think : **I'm learning how to think in logical steps, identifying cause and effect, and always looking for solutions**.
23
21
24
22
## Before you start!
25
23
24
+
### 1. Install some new software!
25
+
26
26
In order to test your JavaScript code, you'll be using software that will execute your files from the command line. This software is called [Node.js](https://nodejs.org/en/download/). Download the Long-Term Support (LTS) version for your specific operating system.
27
27
28
-
- For Windows, click [here](https://nodejs.org/dist/v10.16.0/node-v10.16.0-x64.msi)
29
-
- For Mac, click [here](https://nodejs.org/dist/v10.16.0/node-v10.16.0.pkg)
30
-
- For Linux, click [here](https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz)
After you've installed it, go to your command line interface. Type in the following command:
33
33
34
34
```
35
35
node --version
36
36
```
37
37
38
-
It should show you version `v10.14.2` or higher.
38
+
It should show you version `v12.16.1` or higher.
39
+
40
+
### 2. A new way of submitting homework!
41
+
42
+
Starting from this module you'll submit homework in a different way. You will be only using GIT and GitHub and work **like a real developer would**: pushing code from your computer to GitHub and making pull requests!
43
+
44
+
Before you start with the homework, make a `fork` of the following repository: [HackYourHomework/JavaScript1](https://www.github.com/hackyourhomework/javascript1). You'll always use the **HackYourHomework** version of the module repository whenever you have to submit your homework.
45
+
46
+
Here are the steps to get started:
47
+
48
+
1.`fork` the HackYourHomework repository to your personal account.
49
+
2.`clone` your forked repository to your computer.
50
+
3. Make `GIT` branches for each week. Start at the `master` branch and execute the following (note that they're 3 different commands):
51
+
52
+
```console
53
+
foo@bar:~$ git branch week1-YOURNAME
54
+
foo@bar:~$ git branch week2-YOURNAME
55
+
foo@bar:~$ git branch week3-YOURNAME
56
+
```
57
+
58
+
4.`checkout` to `week1-YOURNAME`
59
+
5. Get started with making your homework!
60
+
61
+
Here's a video in order that shows you how it's done: [How to Submit Your Homework](https://www.youtube.com/watch?v=CpYARPYGQU8)
39
62
40
63
## Learning goals
41
64
42
65
In order to successfully complete this module you will need to master the following:
43
66
44
-
- Have an idea of what computer programming is
45
-
- Know the basic buildingblocks of JavaScript
46
-
- Correctly write and use variables, functions and loops
47
-
- Understand the control flow
48
-
- Think like a programmer
67
+
- Have an idea of what `computer programming` is
68
+
- Know the basic building blocks of `JavaScript`
69
+
- Correctly write and use `variables`, `functions` and `loops`
70
+
- Understand the `control flow`
49
71
50
72
## How to use this repository
51
73
52
-
This repository consists of 3 parts:
74
+
This repository consists of 3 essential parts:
53
75
54
-
1.`Reading materials`: this document contains all the required theory you need to know _**while**_ you're coding. It's meant as both study material and as a reference to understand what you're doing.
55
-
2.`Homework`: this document contains the instructions for each week's homework.
56
-
3.`Lesson Plans`: this part is meant for teachers as a reference. However, as a student don't be shy to take a look at it as well!
76
+
1.`README`: this document contains all the required theory you need to understand **before** class. It's also meant as a reference to understand what you're doing while you're coding.
77
+
2.`MAKEME`: this document contains the instructions for each week's homework.
78
+
3.`LESSONPLAN`: this document is meant for teachers as a reference. However, as a student don't be shy to take a look at it as well!
57
79
58
-
After your first class you should start with checking the `reading materials` for that week. So, for the first time that is the [Week 1 Reading](/Week1/README.md). Study all the concepts and try to get the gist of everything. After, you can get started with the `homework` for that week.
80
+
**Before** the first class of the module you should start off with the [Week 1 Reading](/Week1/README.md). Study all the concepts and try to get the gist of everything. After your first class, you can get started with the [Week 1 Homework](/Week1/MAKEME.md).
59
81
60
82
If you have any questions or if something is not entirely clear ¯\\\_(ツ)\_/¯, please ask/comment on Slack!
Copy file name to clipboardExpand all lines: Week1/MAKEME.md
+42-21Lines changed: 42 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,11 @@ In the following exercises you'll learn how to use different JavaScript concepts
26
26
27
27
**Exercise 1: Hello world!**
28
28
29
-
Write a statement, using the `console.log()` function. Give it a string as an argument. The string should contain the message "Hello world!".
29
+
Write a statement, using the `console.log()` function. It should fulfill the following requirements:
30
30
31
-
Write 10 statements like these, but in different languages.
31
+
- It takes a string as an argument
32
+
- The string should contain the message `"Hello world!"`
33
+
- Execute the function 10 times, each time using the phrase in different languages
32
34
33
35
For example:
34
36
@@ -38,38 +40,44 @@ Ciao, mondo! // Italian
38
40
Hola, mundo! // Spanish
39
41
```
40
42
41
-
Using the command line, navigate to your `js-exercises` folder and type in the following to test your code:
43
+
Finished? Using the command line, navigate to your `js-exercises` folder and type in the following to test your code:
42
44
43
-
```
44
-
node FILENAME.js
45
+
```console
46
+
foo@bar:~$ node FILENAME.js
45
47
```
46
48
47
-
It should show the message `Hello world!` in 10 different languages.
49
+
Expected output: It should show the message `Hello world!` in 10 different languages.
48
50
49
51
**Exercise 2: Error debugging**
50
52
51
53
Consider the following code:
52
54
53
55
```js
54
-
console.log('I'm awesome');
56
+
console.log('I'm awesome'!;
55
57
```
56
58
57
-
Copy the code in your `.js` file and run it in the command line using `node`. You will see that you will get a SyntaxError. **Correct the mistake**.
59
+
Here are the requirements:
60
+
61
+
- Copy the code in your `.js` file and run it in the command line using `node`.
62
+
63
+
You will see that you will get a [SyntaxError](https://techterms.com/definition/syntax_error).
58
64
59
-
Hint: the SyntaxError message will give you some indication of what the error _might_ be, but figure out yourself how to correct it!
65
+
- **Correct the mistake**.
60
66
61
-
When done right, it should show the message `I'm awesome`.
67
+
> Hint: the SyntaxError message will give you some indication of what the error _might_ be, but figure out yourself how to correct it!
68
+
69
+
Expected output: When done right, the command line should show the message `I'm awesome!`.
62
70
63
71
**Exercise 3: Log the number**
64
72
65
73
Follow the steps. Make sure that each step is written on the line after.
66
74
67
-
1. First, declare your variable `numberX`. Do not _initialize_ it (which means, don't give it a value) yet.
68
-
2. Add a `console.log` statement that explains in words _what you think_ the value of `x` is, like in this example.
75
+
1. First, declare your variable `numberX`. Do not _initialize_ it (which means, don't give it a starting value) yet
76
+
2. Add a `console.log` statement that explains in words _what you think_ the value of `x` is
69
77
3. Add a `console.log` statement that logs the value of `numberX`.
70
-
4. Now _initialize_ your variable `numberX` with a number (also called an `integer` in computer science terms).
71
-
5. Next, add a `console.log` statement that explains _what you think_ the value of `numberX` is.
72
-
6. Add a `console.log` statement that logs the value of `numberX`.
78
+
4. Now _initialize_ your variable `numberX` with a number (also called an `integer` in computer science terms)
79
+
5. Next, add a `console.log` statement that explains _what you think_ the value of `numberX` is
80
+
6. Add a `console.log` statement that logs the value of `numberX`
73
81
74
82
**Exercise 4: Log the string**
75
83
@@ -86,7 +94,7 @@ Follow the steps. Make sure that each step is written on the line after.
86
94
87
95
Follow the steps. Make sure that each step is written on the line after.
88
96
89
-
1. Declare a variable `z` and assign the number 7.25 to it.
97
+
1. Declare a variable `z` and assign the number `7.25` to it.
90
98
2. Write a `console.log` statement in which you log the value of `z`.
91
99
3. Declare another variable `a` that has the value of `z` but rounded to the nearest integer.
92
100
4. Write a `console.log` statement in which you log the value of `a`.
@@ -115,7 +123,14 @@ Follow the steps. Make sure that each step is written on the line after.
115
123
116
124
**Exercise 8: Type checker**
117
125
118
-
Write a program that checks the data types of two variables and logs to the console `SAMETYPE` if they are the same type. If they are different types log `Not the same...`.
126
+
Create a `function` that fulfills the following requirements:
127
+
128
+
- Takes in 2 arguments
129
+
- Check the data type of each
130
+
- Compares each data type
131
+
- Logs to the console the message `SAME TYPE` if they are the same type. If they are different types log `Not the same...`.
132
+
133
+
Follow the steps:
119
134
120
135
1. Declare 4 variables: 2 must be `strings` and 2 must be `objects`
121
136
2. Create 6 conditional statements, where for each you check if the data type of one variable is the same as the other
@@ -142,14 +157,16 @@ if (...) {
142
157
143
158
**Exercise 9: Log the remainder**
144
159
145
-
For each of these, write in comments what the answer is followed by how you came to that conclusion
160
+
Answer the following questions. For each, write in comments what the answer is followed by how you came to that conclusion:
146
161
147
162
1. If `x` equals 7, and the only other statement is `x = x %3`, what would be the value of `x` after the calculation?
148
163
2. If `y` equals 21, and the only other statement is `y = y %4`, what would be the value of `y` after the calculation?
149
164
3. If `z` equals 13, and the only other statement is `z = z %2`, what would be the value of `z` after the calculation?
150
165
151
166
**Exercise 10: Compare arrays**
152
167
168
+
Follow the steps:
169
+
153
170
1. Declare 2 variables, that each hold an array. The first array should have 4 items, the second 7 items
154
171
2. Find out how to get the length of each array. Write a `console.log` statement that shows the length of each array
155
172
@@ -163,19 +180,23 @@ console.log('The length of the array is...' + ...);
163
180
164
181
## **3. Code along**
165
182
183
+
> Create a new GitHub repository for this project. It's a portfolio piece!
184
+
166
185
We don't want to lose the connection with HTML/CSS, so in the following tutorial you'll learn how to build a simple web application use HTML/CSS and JavaScript.
167
186
168
-
You'll first write the HTML and CSS, to provide structure and style to the page. When doing so, keep notice of how the developer chooses to do this. Why do they use this tag instead of something else? Why do they give an element a certain class name?
187
+
You'll first write the HTML and CSS, to provide structure and style to the page. When doing so, notice how the developer chooses to do this. Why do they use this tag instead of something else? Why do they give an element a certain class name?
169
188
170
189
After, the developer will write JavaScript code. You'll notice it's different from how you've used JavaScript. It is something we call **DOM Manipulation**. Don't worry, you don't need to master this just yet. Just follow along and do some research yourself if you already want to learn more about it!
After you've finished your todo list it's time to show us what you got! Starting from this week you'll be submitting all your homework through GitHub. What you'll be doing is upload all your files to a forked repository (a copy from the original, which in this case is the [JavaScript1](https://www.github.com/HackYourFuture/JavaScript1) repository) using GIT.
195
+
After you've finished your todo list it's time to show us what you got! Starting from this week you'll be submitting all your homework through GitHub. What you'll be doing is upload all your files to a separate repository.
196
+
197
+
Go over to [HackYourHomework/JavaScript1](https://www.github.com/HackYourHomework/JavaScript1). Notice how it's **HackYourHomework**, a repository meant to submit the homework!
177
198
178
-
Take a look at the following [guide](../hand-in-homework-guide.md) to see how it's done.
199
+
Then take a look at the following [guide](../hand-in-homework-guide.md) to see to set everything up.
179
200
180
201
The homework that needs to be submitted is the following:
0 commit comments