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

Skip to content

Commit 987a0e7

Browse files
committed
moved some assignments to week3 also added some assignments, + implemented feedback from Jim about ;'s and language
1 parent 6415aba commit 987a0e7

File tree

3 files changed

+113
-76
lines changed

3 files changed

+113
-76
lines changed

Week0/README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,25 @@ In week one we will discuss the following topics:
55
• The first part of the day Unmesh will talk about CLI (Command Line Interface)
66
• Intro JavaScript (What is it, where can you use it for)
77
• Variables [var, let, const]
8-
• Basic Data types [Strings, Numbers, Arrays]
8+
• Basic Data types [Strings, Numbers, Arrays, Booleans]
99
• Operators
1010
```
1111

12+
13+
## How to get started
14+
1. Download and install the latest Current version of NodeJS - from https://nodejs.org/en/download/current/
15+
To test that it was installed and running properly, go to your terminal and run the command: node -v You should get the node version printed on your terminal, for example, v8.8.0
16+
1217
### Here are resources that we like you to read as a preparation for the coming lecture:
1318

19+
Please watch the following parts of the course, [Programming Foundations Fundamentals](https://www.lynda.com/Programming-Foundations-tutorials/Welcome/83603/90426-4.html) on Lynda.com (if you don't have access to Lynda yet ask Gijs):
20+
21+
Only watch the below chapters:
22+
0. Introduction
23+
1. Programming Basics
24+
2. Core Programming Syntax
25+
3. Variables and Data Types
26+
1427
- Read this ~ http://speakingjs.com/es5/ch01.html read up to and including the *Strings* chapter (it’s okay if you don’t understand all of it yet, we will cover these concepts in class as well. Do make sure to write or document the questions you have so we can discuss them in class)
1528

1629
- Read the entire JavaScript Introduction at MDN~ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Introduction

Week1/MAKEME.md

Lines changed: 71 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
>[Here](https://github.com/HackYourFuture/JavaScript/tree/master/Week1/README.md) you find the readings you have to complete before the second lecture.
44
5-
We covered a bit of command line usage in the first class and got a program running which is great. If you need a refresher for the command line please have a look here: https://github.com/HackYourFuture/CommandLine
6-
75
## Before you start with the homework:
86

97
1. Watch: [What is programming](https://www.khanacademy.org/computing/computer-programming/programming/intro-to-programming/v/programming-intro) Just watch the 2 min video, you do not have to do the entire JavaScript course (It could be useful later on though).
@@ -15,6 +13,8 @@ We covered a bit of command line usage in the first class and got a program runn
1513

1614
## Step 1: Command Line
1715

16+
>We covered a bit of command line usage in the first class and got a program running which is great. If you need a refresher for the command line please have a look here: https://github.com/HackYourFuture/CommandLine
17+
1818
1. Create a `.js` file that prints `Hello` when you run it from the command line. (Hint: `node` is the program that can run your JavaScript files.)
1919

2020
```
@@ -35,106 +35,105 @@ Write commands to do following:
3535

3636
## Step 2: JavaScript
3737

38-
> For all the following exercises create a new .js file. Try to find a proper name for each file or make a small comment about what it does inside for future reference.
38+
> For all the following exercises create a new .js file. Try to find a proper name for each file or make a small comment about what it does inside for future reference. All these
39+
40+
1. Write a console.log statement saying "Hello World!" for each language that you know.
41+
42+
2. Consider the following code:
43+
```
44+
console.log('I'm awesome');
45+
```
46+
2.1 Copy the code in your `.js` file and run it. You will see that you will get a SyntaxError. Find a solution for this error, Hint read the error message carefully, it also gives an indication of where the problem is.
3947

40-
1. Declare a variable `x` and initialize it with an integer.
41-
1.1 First, _declare_ your variable `x`.
42-
1.2 Add a console.log statement that explains what _you think_the value of `x` is, like in this example:
48+
3. Declare a variable `x` and initialize it with an integer.
49+
3.1 First, _declare_ your variable `x`.
50+
3.2 Add a console.log statement that explains that explains in words what _you think_the value of `x` is, like in this example:
4351
```js
4452
// TODO -> here you initialize your variable
45-
console.log('the value of my variable x will be: whateverYouThinkItWillLog')
53+
console.log('the value of my variable x will be: whateverYouThinkItWillLog');
4654
```
47-
1.3 Add a console.log statement that logs the value of `x`
48-
1.4 Now _initialize_ your variable `x` with an integer
49-
1.5 Now add a console.log statement that explains what _you think_ the value of `x` is.
50-
1.6 Add a console.log statement that logs the value of `x`.
55+
3.3 Add a console.log statement that logs the value of `x`
56+
3.4 Now _initialize_ your variable `x` with an integer
57+
3.5 Now add a console.log statement that explains what _you think_ the value of `x` is.
58+
3.6 Add a console.log statement that logs the value of `x`.
5159
Steps to be taken:
5260

5361
```js
5462
// TODO -> here you declare your variable
55-
console.log('the value of x will be: whateverYouThinkItWillLog')
63+
console.log('the value of x will be: whateverYouThinkItWillLog');
5664
// TODO -> log the actual value of x
5765
// TODO -> here you initialize your variable
58-
console.log('the value of x will be: whateverYouThinkItWillLog')
66+
console.log('the value of x will be: whateverYouThinkItWillLog');
5967
// TODO -> log value of x again
6068
```
6169

62-
2. Declare a variable `y` and assign a string to it.
63-
2.1 Write a console.log statement in which explain what you think the value of the string is
64-
2.2 Now console.log the variable `y`.
65-
2.3 Now assign a new string to the variable `y`
66-
2.4 Just like you did before write a console.log statement that explains what you think will be logged to the console.
67-
2.5 Now console.log `y` again.
70+
4. Declare a variable `y` and assign a string to it.
71+
4.1 Write a console.log statement in which you explain in words what _you think_ the value of the string is
72+
4.2 Now console.log the variable `y`.
73+
4.3 Now assign a new string to the variable `y`
74+
4.4 Just like you did before write a console.log statement that explains in words what you think will be logged to the console.
75+
4.5 Now console.log `y` again.
6876
```js
6977
// TODO -> here you declare AND assign your string
70-
console.log('the value of my string will be: whateverYouThinkItWillLog')
78+
console.log('the value of my string will be: whateverYouThinkItWillLog');
7179
// TODO -> log the actual value of the string to the console
7280
// TODO -> assign a new value to your variable x
73-
console.log('the value of my string will be: whateverYouThinkItWillLog')
81+
console.log('the value of my string will be: whateverYouThinkItWillLog');
7482
// TODO -> log the actual value of the string to the console
7583
```
7684

77-
3. How do you round the number 7.25, to the nearest integer?
78-
3.1 Declare a variable `z` and assign the number 7.25 to it.
79-
3.2 Console.log `z`.
80-
3.3 Now round `z` to the nearest integer.
81-
3.4 Console.log `z` again.
82-
83-
4. Arrays!
84-
4.1 Declare an empty array (you can decide on how to call it yourself).
85-
4.2 Write a console.log statement in which explain what you think the value of the array is.
86-
4.3 Console.log your array.
87-
4.4 Create an array that has your favorite animals inside
88-
4.5 Log your array
89-
4.6 Ads Daan's favorite animal (baby pig) to the existing array
90-
4.7 Log your new array!
91-
4.8 Now add Gijs's favorite animal to the array (moose), but make sure it will be placed after the first animal that you have placed in your array.
92-
4.9 Write a console.log statement in which explain what _you think_ the new value of the array is.
93-
4.10 Log your new new array!
94-
4.11 Log the length of the array, add a message: "The array has a length of: "(here you should show the length of the array)
95-
4.12 Eyad does not like giraffes, delete this animal from the array
96-
4.13 Again log your new array.
97-
4.14 Now if unlike Gijs, you don't like mooses and you want to delete it from the array, but you don't know the position or the `index` of the item in the array, how can you find it?
98-
4.15 Log the index of moose to the console. Add a message so it says: "The item you are looking for is at index: " (here you should show the index of the item)
99-
100-
5. More strings
101-
5.1 Let's consider the following string: `let mystring = "this,is,a,test"`.
102-
5.2 Add the string to your file and console.log it.
103-
5.3 Find a way to get the length of `mystring`.
104-
5.4 Console.log the length of `mystring`.
105-
5.5 The comma's make that the sentence is quite hard to read. Find a way to remove the comma's from the sting and replace them with a spaces
106-
5.6 Console.log `mystring` to see if you succeeded.
107-
108-
109-
7. Write a program that checks the types of two variables and prints out `SAME TYPE` if they are the same type.
110-
6.1 First declare at least four variables and assign them with different data types.
111-
6.2 For each variable write a console log statement that that logs the value
85+
5. How do you round the number 7.25, to the nearest integer?
86+
5.1 Declare a variable `z` and assign the number 7.25 to it.
87+
5.2 Console.log `z`.
88+
5.3 Declare another variable `a` that has the value of z but rounded to the nearest integer.
89+
5.4 Console.log `a`
90+
5.5 So now we have `z` and `a` find a way to compare the two values and store the highest of the two in a new variable.
91+
5.6 Console.log the highest value.
92+
93+
6. Arrays!
94+
6.1 Declare an empty array (you can decide on how to call it yourself, but read on a bit here and see if you can find a good name that exactly describes what this variable will hold).
95+
6.2 Write a console.log statement that explains in words what you think the value of the array is.
96+
6.3 Console.log your array.
97+
6.4 Create an array that has your favorite animals inside
98+
6.5 Log your array
99+
6.6 Add a statement that adds Daan's favorite animal (baby pig) to the existing array
100+
6.7 Log your new array!
101+
102+
7. More strings
103+
7.1 Let's consider the following string: `let myString = "this,is,a,test"`.
104+
7.2 Add the string to your file and console.log it.
105+
7.3 Find a way to get the length of `myString`.
106+
7.4 Console.log the length of `myString`.
107+
108+
8. Write a program that checks the types of two variables and prints out `SAME TYPE` if they are the same type.
109+
8.1 First declare at least four variables and assign them different data types.
110+
8.2 For each variable write a `console.log` statement that logs the value
112111
```js
113-
let foo = 3
114-
console.log('My the value of my variable foo is: ' + foo)
112+
let foo = 3;
113+
console.log('The value of my variable foo is: ' + foo);
115114
```
116-
6.3 Now write a console.log statement weiring you first explain what you think the _type_ of your variables is.
117-
6.4 Now use `typeof` to log the actual _type_ of your variables.
118-
6.5 Now compare the types of your different variables with one another.
119-
6.6 Make sure to also show a message when the variables you are comparing are not the same type.
115+
8.3 Now write a console.log statement wherein you first explain in words what you think the _type_ of your variables is.
116+
8.4 Now use `typeof` to log the actual _type_ of your variables.
117+
8.5 Now compare the types of your different variables with one another.
118+
8.6 Make sure to also show a message when the variables you are comparing are not the same type.
120119
For example:
121120
```js
122-
let x = 9
123-
let y = 'Hello'
121+
let x = 9;
122+
let y = 'Hello';
124123

125124
if () {
126-
console.log('SAME TYPE')
125+
console.log('SAME TYPE');
127126
}
128127
// TODO -> add a way of giving feedback if your variables don't have the same type
129128
```
130129

131-
8. If `x` equals 7, and the only other statement is `x = x % 3`, what would be the new value of `x`?
132-
6.1 Add at least 3 `console.log` statements in which you show that you understand what `%` does.
130+
9. If `x` equals 7, and the only other statement is `x = x % 3`, what would be the new value of `x`?
131+
9.1 Add at least 3 `console.log` statements in which you show that you understand what `%` does.
133132

134-
9. Write a program to answer the following questions:
135-
7.1 Can you store multiple types in an array? Numbers and strings?
136-
7.2 Can you compare inifities? (Not in Eyad's world) - does 6/0 == 10/0? How can you test this?
137-
7.3 Add console.log statements to the above program's in which you show that you understand the concepts (just like you've done in the above assignments).
133+
10. Write a program to answer the following questions:
134+
10.1 Can you store multiple types in an array? Numbers and strings?
135+
10.2 Can you compare infinities? (Not in Eyad's world) - does 6/0 === 10/0? How can you test this?
136+
10.3 Add console.log statements to the above program's in which you show that you understand the concepts (just like you've done in the above assignments).
138137

139138
### Step 3: **Some freeCodeCamp challenges (10 hours):**
140139

@@ -156,7 +155,7 @@ steps:
156155
```
157156

158157
### Hint
159-
If you solve the FreeCodeCamp challenges and they are new concepts to you and you would like to take a look at them later on in the program, Copy your answers from FCC in a .js file and upload them to Github in a repository for future reference. In this way you build your own little documentation, if you look back at them first try to understand what it does before you run them.
158+
If you solve the FreeCodeCamp challenges and they are new concepts to you and you would like to take a look at them later on in the program, Copy your answers from FCC in a `.js` file and upload them to Github in a repository for future reference. In this way you build your own little documentation, if you look back at them first try to understand what it does before you run them.
160159

161160
:star: Additional resources and review: [here](https://github.com/HackYourFuture/JavaScript/tree/master/Week1/REVIEW.md) (work in progress):star:
162161

Week3/MAKEME.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,34 @@ Your fellow students have provided you with feedback in Trello. Your teachers ha
1616

1717
## Step 2: Reorganize your Github
1818

19-
Your Github should contain two repositories called hyf-javascript1 and hyf-commandline . Inside the JavaScript repository you should have three folders, called week1, week2, and week3 (or something similar). Inside these folders you should have the different assignments (a file per exercises). Ty and find proper names for the exercises that reflect somehow what is going on in the code. Avoid using spaces in your file names, this makes it harder to "run" you files. Also make sure that all your JavaScript files have a .js extension.
19+
Your Github should contain two repositories called hyf-javascript1 and hyf-commandline . Inside the JavaScript repository you should have three folders, called week1, week2, and week3 (or something similar). Inside these folders you should have the different assignments (a file per exercises). Ty and find proper names for the exercises that reflect somehow what is going on in the code. Avoid using spaces in your file names, this makes it harder to "run" you files. Also make sure that all your JavaScript files have a `.js` extension.
2020

21-
## Step 3: Custom DOM manipulation challenge :mortar_board:
21+
## Step 3: String and Array challenges
22+
23+
1. Strings!
24+
1.1 Let's consider the following string: `let myString = "hello,this,is,a,difficult,to,read,sentence"`
25+
1.2 Add the string to your file and console.log it.
26+
1.4 Console.log the length of `myString`.
27+
1.5 The comma's make that the sentence is quite hard to read. Find a way to remove the comma's from the sting and replace them with a spaces
28+
1.6 Console.log `myString` to see if you succeeded.
29+
30+
2. Arrays!
31+
consider the following array:
32+
```js
33+
let favoriteAnimals = ['blowfish', 'capricorn', 'giraffe'];
34+
```
35+
2.6 Add a statement that adds Mauro's favorite animal (turtle) to the existing array
36+
2.7 Log your new array!
37+
2.8 Now add Jim's favorite animal to the array, its a meerkat, but make sure it will be placed after 'blowfish' and before 'capricorn'.
38+
2.9 Write a console.log statement that explains in words _you think_ the new value of the array is.
39+
2.10 Log your new new array!
40+
2.11 Log the length of the array, add a message: "The array has a length of: "(here you should show the length of the array)
41+
2.12 Jason does not like giraffes, delete this animal from the array
42+
2.13 Again log your new array.
43+
2.14 Now if unlike Jim, you don't like meerkats and you want to delete it from the array, but you don't know the position or the `index` of the item in the array, how can you find it?
44+
2.15 Log the index of meerkat to the console. Add a message so it says: "The item you are looking for is at index: " (here you should show the index of the item)
45+
46+
## Step 4: Custom DOM manipulation challenge :mortar_board:
2247

2348
1. Open a new js file and start by declaring an array that contains 10 strings. These strings should be of book titles you have read (or made up) and be lowercase without spaces or special characters so that you can use these later as Id's. (Example: Harry Potter's - The Chamber of Secrets -> `harry_potter_chamber_secrets`).
2449

@@ -42,7 +67,7 @@ How to hand in your homework:
4267
• Place the link to your repository folder in Trello.
4368
```
4469

45-
## Step 4: **FreeCodeCamp challenges:**
70+
## Step 5: **FreeCodeCamp challenges:**
4671

4772
- https://www.freecodecamp.com/challenges/declare-javascript-objects-as-variables
4873
- https://www.freecodecamp.com/challenges/make-instances-of-objects-with-a-constructor-function

0 commit comments

Comments
 (0)