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

Skip to content

Commit e4692fa

Browse files
committed
homework update
1 parent 1078851 commit e4692fa

File tree

5 files changed

+97
-52
lines changed

5 files changed

+97
-52
lines changed

Week1/MAKEME.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,7 @@ For example:
7373

7474
### Step 3: **Some freeCodeCamp challenges (10 hours):**
7575

76-
On freeCodeCamp.com please do all [Basic JavaScript](https://www.freecodecamp.com/challenges/learn-how-free-code-camp-works) exercises (there are some topics we did not cover but you can do it). Please make sure you REALLY understand the exercises below:
77-
78-
- https://www.freecodecamp.com/challenges/multiply-two-decimals-with-javascript
79-
- https://www.freecodecamp.com/challenges/store-multiple-values-in-one-variable-using-javascript-arrays
80-
- https://www.freecodecamp.com/challenges/build-javascript-objects
81-
- https://www.freecodecamp.com/challenges/add-new-properties-to-a-javascript-object
82-
- https://www.freecodecamp.com/challenges/delete-properties-from-a-javascript-object
76+
On freeCodeCamp.com please do the [Basic JavaScript](https://www.freecodecamp.com/challenges/learn-how-free-code-camp-works) exercises up and until the __"Shopping List"__ exercise (there are some topics we did not cover but you can do it).
8377

8478
> Hint, 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 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.
8579

Week2/MAKEME.md

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
## Homework Week 2
22

3-
### Step 1: JavaScript
3+
### Step 1: Recap/Read
4+
5+
- Have a look at [The Secret Life of JavaScript Primitives](https://javascriptweblog.wordpress.com/2010/09/27/the-secret-life-of-javascript-primitives/)
6+
- Go through the review of [last week](https://github.com/HackYourFuture/JavaScript/blob/master/Week1/REVIEW.md) (Work in progress, update this week :wrench:)
7+
- Go through the review of [this week](https://github.com/HackYourFuture/JavaScript/blob/master/Week2/REVIEW.md) (work in progress, update this week :nut_and_bolt:)
8+
9+
### Step 2: Watch
10+
11+
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):
12+
4. Writing Conditional Code
13+
5. Modular Code
14+
6. Iteration: Writing Loops
15+
7. More About Strings
16+
8. Collections
17+
11. When Things Go Wrong
18+
19+
### Step 3: JavaScript
420
> 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
521
622
1. Create a function that takes 3 arguments and returns the sum of the three arguments.
@@ -28,7 +44,7 @@ if (3 == 3) {
2844

2945
9. Change the function `vehicle` to use the list of question 5. So that `vehicle("green", 3, 1)` prints "a green new caravan".
3046

31-
10. Use the list of vehicles to write an advertisment. So that it prints something like: `"Amazing Joe's Garage, we service cars, motorbikes, caravans and bikes."`. (Hint: use a `for` loop.)
47+
10. Use the list of vehicles to write an advertisement. So that it prints something like: `"Amazing Joe's Garage, we service cars, motorbikes, caravans and bikes."`. (Hint: use a `for` loop.)
3248

3349
11. What if you add one more vehicle to the list, can you have that added to the advertisement without changing the code for question 8?
3450

@@ -88,15 +104,8 @@ Check out this [Fiddle](http://jsfiddle.net/jimschubert/85M4z/). You need to ope
88104

89105
More insights from this [Stack Overflow question](http://stackoverflow.com/questions/22395357/how-to-compare-two-arrays-are-equal-using-javascript).
90106

91-
### Step 2: **Some freeCodeCamp challenges:**
92-
93-
1. [Comparisons with the Logical And Operator](https://www.freecodecamp.com/challenges/comparisons-with-the-logical-and-operator)
94-
95-
2. [Record Collection](https://www.freecodecamp.com/challenges/record-collection)
96107

97-
3. [Iterate over Arrays with map](https://www.freecodecamp.com/challenges/iterate-over-arrays-with-map)
98-
99-
4. We did the following example in class:
108+
14. Take a look at the following code:
100109

101110
```js
102111
var o1 = { foo: 'bar' };
@@ -109,11 +118,19 @@ More insights from this [Stack Overflow question](http://stackoverflow.com/quest
109118

110119
Does the order that you assign (`o3 = o2` or `o2 = o3`) matter? {Jim Cramer: ???}
111120

112-
### Some further reading:
113-
114-
Have a look at [The Secret Life of JavaScript Primitives](https://javascriptweblog.wordpress.com/2010/09/27/the-secret-life-of-javascript-primitives/)
115121

116122
> ‘Coerce' means to try to change - so coercing `var x = '6'` to number means trying to change the type to number temporarily.
117123
124+
### Step 4: **Finish basic freeCodeCamp challenges:**
125+
126+
Go back to FreeCodeCamp, start where you left of and finish the rest of the Basic JavaScript challenges.
127+
128+
Please make sure you REALLY understand the exercises below:
129+
- https://www.freecodecamp.com/challenges/multiply-two-decimals-with-javascript
130+
- https://www.freecodecamp.com/challenges/store-multiple-values-in-one-variable-using-javascript-arrays
131+
- https://www.freecodecamp.com/challenges/build-javascript-objects
132+
- https://www.freecodecamp.com/challenges/add-new-properties-to-a-javascript-object
133+
- https://www.freecodecamp.com/challenges/delete-properties-from-a-javascript-object
134+
118135
:star: Additional resources and review: [here](https://github.com/HackYourFuture/JavaScript/tree/master/Week2/REVIEW.md) (work in progress):star:
119136

Week2/REVIEW.md

Lines changed: 53 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,59 @@ This review covers:
1010
• Naming conventions
1111
```
1212

13+
### Recap Logical operators:
14+
15+
```js
16+
0 = false
17+
1 = true
18+
```
19+
20+
#### AND `&&`
21+
22+
|`&&`|0|1|
23+
|----|-|-|
24+
|0|0|0|
25+
|1|0|1|
26+
27+
#### OR `||`
28+
29+
|`||`|0|1|
30+
|----|-|-|
31+
|0|0|1|
32+
|1|1|1|
33+
34+
## Objects
35+
36+
Variables that are objects also contain a list of things, but instead of them being in some specific order, they can be assigned to words, called "keys". Instead of "elements" the things that are inside objects are called "properties".
37+
38+
39+
```js
40+
let obj = {name: 'John', age: 24};
41+
```
42+
43+
This object has two properties: `name` and `age`. The "value" of the property `name` is the string `'John'`. The "value" of the property `age` is the number `24`.
44+
45+
When accessing object properties, you can use the dot-notation: `obj.name` or the bracket-notation: `obj["name"]`. Note that the latter looks a lot like the way to access array elements. However, here what's inside the bracket (called "key" for objects, instead of "index") must be a string.
46+
47+
```js
48+
console.log(obj.name); // -> 'John'
49+
console.log(obj['name']); // -> 'John'
50+
```
51+
52+
Just like with arrays, you can also use a variable to access properties, as long as these variables are strings. In this case you cannot use the dot-notation!
53+
54+
```js
55+
var ageKey = 'age';
56+
console.log(obj[ageKey]); // -> 24
57+
```
58+
59+
Remember that there is a very big difference between `obj[name]` and `obj["name"]`.
60+
61+
> Note:
62+
>
63+
> Thinking back of arrays, the length of an array can be retrieved by `arr.length`. So as mentioned before, arrays are just like other JavaScript objects. You could even write `arr['length']` to access the `length` property of the array. JavaScript will look: is what we put between brackets a number? Then it is an index and we'll look up the correct array element. If it's a string, it's a key and we will look up the corresponding property.
64+
65+
1366
## Functions
1467

1568
A function is a reusable piece of code. Functions are *very* important in JavaScript, to the extent that some people call JavaScript a "function-oriented" language. As mentioned above, variables can be of type function. In fact, *every function is a variable*.
@@ -89,38 +142,6 @@ myNumber.toString();
89142
```
90143

91144

92-
## Objects
93-
94-
Variables that are objects also contain a list of things, but instead of them being in some specific order, they can be assigned to words, called "keys". Instead of "elements" the things that are inside objects are called "properties".
95-
96-
97-
```js
98-
var obj = {name: 'John', age: 24};
99-
```
100-
101-
This object has two properties: `name` and `age`. The "value" of the property `name` is the string `'John'`. The "value" of the property `age` is the number `24`.
102-
103-
When accessing object properties, you can use the dot-notation: `obj.name` or the bracket-notation: `obj["name"]`. Note that the latter looks a lot like the way to access array elements. However, here what's inside the bracket (called "key" for objects, instead of "index") must be a string.
104-
105-
```js
106-
console.log(obj.name); // -> 'John'
107-
console.log(obj['name']); // -> 'John'
108-
```
109-
110-
Just like with arrays, you can also use a variable to access properties, as long as these variables are strings. In this case you cannot use the dot-notation!
111-
112-
```js
113-
var ageKey = 'age';
114-
console.log(obj[ageKey]); // -> 24
115-
```
116-
117-
Remember that there is a very big difference between `obj[name]` and `obj["name"]`.
118-
119-
> Note:
120-
>
121-
> Thinking back of arrays, the length of an array can be retrieved by `arr.length`. So as mentioned before, arrays are just like other JavaScript objects. You could even write `arr['length']` to access the `length` property of the array. JavaScript will look: is what we put between brackets a number? Then it is an index and we'll look up the correct array element. If it's a string, it's a key and we will look up the corresponding property.
122-
123-
124145
## Statements & expressions
125146

126147
Most programming languages that you'll encounter in real life are called "imperative" programming languages. JavaScript is such an imperative programming language. Imperative is another word for command-like. That is, you give the computer a bunch of commands after each other. First do this, then do that, etc.

Week3/MAKEME.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ https://developer.mozilla.org/en/docs/Web/JavaScript/Closures
1515

1616
And just for fun ... https://www.freecodecamp.com/challenges/sum-all-numbers-in-a-range
1717

18+
19+
20+
1821
## And a custom DOM manipulation challenge :mortar_board:
1922

2023
1. Open a new js file and start by declaring in array with in there 10 strings. These strings should be of book title's 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`).

Week7/MAKEME.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
- Add polling to your app so that it checks every minute or so if a new repo has been made and if it has, adds it to the DOM without reloading the page.
1212
- Add a readme to your repo explaining what your app does and how to use your app. Here's a [template](https://gist.github.com/jxson/1784669) and here you can see how to make [your readme awesome](https://gist.github.com/rrgayhart/91bba7bb39ea60136e5c).
1313

14+
### Step 2: **Some freeCodeCamp challenges:**
15+
16+
1. [Comparisons with the Logical And Operator](https://www.freecodecamp.com/challenges/comparisons-with-the-logical-and-operator)
17+
18+
2. [Record Collection](https://www.freecodecamp.com/challenges/record-collection)
19+
20+
3. [Iterate over Arrays with map](https://www.freecodecamp.com/challenges/iterate-over-arrays-with-map)
21+
22+
23+
1424
## What we did in lecture 1:
1525
Code Kata Race
1626

0 commit comments

Comments
 (0)