Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 7d6c81b

Browse files
Gabe Rodriguezkvarak
authored andcommitted
Adding Functions lecture notes
1 parent 6a398b9 commit 7d6c81b

File tree

5 files changed

+57
-53
lines changed

5 files changed

+57
-53
lines changed

Week2/LECTURENOTES.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,29 @@ Cover individual topics that students may still be stuck on from previous lectur
2323
* protobufs
2424
* XML
2525
* GRPC?!
26-
27-
28-
29-
## Functions + JSON
30-
31-
## Higher order functions
32-
## Arrow functions
33-
34-
35-
26+
* Cover homework question #3
27+
28+
## Functions advanced (12-12:30pm)
29+
* Different ways functions can be made:
30+
* function declaration vs expression
31+
* arrow function
32+
* Omitting return, parameter parenthesis
33+
* What's a method?
34+
* Pure function? or side effects?
35+
* Example: how does a program run this? (example w/ a function, call of that function, and a console log)
36+
* Call stack (stack overflow)
37+
* Params
38+
* Extra params
39+
* Default params
40+
* Recursion (basic example)
41+
* Example function
42+
* pigs example?
43+
* countChar("kakkerlak", "k")? With DOM manipulation?
44+
* Simplicity of functions
45+
* while loop from [Chapter 5](http://eloquentjavascript.net/05_higher_order.html)
46+
* Higher order functions
47+
* repeat(n, action)
48+
* greaterThan10
3649

3750
## Array Manipulations
38-
## Map and filter
39-
## Reduce (every?)
40-
41-
## Discuss Homework (20mins)
42-
51+
## Map, Filter, Reduce (others? every, some, etc)

Week2/MAKEME.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,14 @@
22

33
```
44
Topics discussed this week:
5-
• Functions + JSON/Arrays
6-
• Array Manipulations
75
• JSON
8-
• Map and filter
9-
• Arrow functions
6+
• Functions advanced
7+
• Array Manipulations
8+
• Map, filter, & reduce
109
```
1110

1211
> [Here](/Week3/README.md) you find the readings you have to complete before the third lecture.
1312
14-
## Step 0: JSON parsing
15-
1. Create an HTML file
16-
2. Insert a script tag that points to squirtle-sprites.js
17-
3. In squirtle-sprites.js, convert pokemonDataJSONString to a javascript object so you can access its properties
18-
4. Display the sprite images (located in the parsed object) in the HTML page. You'll need to do some DOM manipulation kinda of stuff (maybe element.appendChild?)
19-
*Bonus Challenge*: Can you use an array method to loop over all sprites so you don't have to manually type each?
20-
2113
## Step 1: More map, filter and `=>`
2214

2315
_Deadline Wednesday_
@@ -146,7 +138,13 @@ If that's the case, try and fix the error. When done, run the tests again: `npm
146138

147139
Repeat the previous step until all (= 2 in this case) tests pass.
148140

149-
## Step 3: ROVER
141+
## Step 3: JSON parsing
142+
143+
1. Create an HTML file
144+
2. Insert a script tag that points to squirtle-sprites.js
145+
3. In squirtle-sprites.js, call fetchPokemonData() and convert the JSON string it returns to a javascript object so you can access its properties
146+
4. Display the sprite images (located in the parsed object) in the HTML page. You'll need to do some DOM manipulation kinda of stuff (maybe element.appendChild?)
147+
*Bonus Challenge*: Can you use an array method to loop over all sprites so you don't have to manually type each?
150148

151149
Finish up to chapter 7: JSON on [roverjs.com](http://roverjs.com/)!
152150

@@ -178,3 +176,6 @@ Go over your homework one last time:
178176
If the answer is 'yes' to all preceding questions you are ready to follow these instructions:
179177

180178
- [Handing in homework](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/homework_pr.md)
179+
180+
### Do you have even more time?
181+
Read the _Eloquent Javascript_ chapters in the [Week 2 Readme](./README.md)

Week2/README.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,32 @@
44

55
```
66
In week two we will discuss the following topics:
7-
• Functions + JSON/Arrays
8-
• Array Manipulations
97
• JSON
10-
• Map and filter
11-
• Arrow functions
8+
• Functions advanced
9+
• Array Manipulations
10+
• Map, filter, & reduce
1211
```
1312

1413
## Here are resources that we like you to read as a preparation for the coming lecture.
1514

1615
### JSON
17-
- [JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON) (MDN)
16+
- [FreeCodeCamp JSON](https://www.youtube.com/watch?v=B-k76DMOj2k)
17+
- [What is JSON and why does one use it?](https://www.quora.com/What-is-JSON-and-why-does-one-use-it/answer/Prid-Speed?ch=10&share=0b6f9763&srid=XxbK)
1818

1919
### Map and Filter
2020
- :dizzy: [Fun fun functional](https://www.youtube.com/playlist?list=PL0zVEGEvSaeEd9hlmCXrk5yUyqUag-n84) :dizzy: Check the first 3-4 videos.
2121

22-
### Code conventions
23-
- Code conventions: http://crockford.com/javascript/code.html
24-
2522
### Array cardio
2623
- Wes Bos' awesome free tutorials. Just make a free account and do Array Cardio #1 [here](https://javascript30.com/)
2724

28-
### From _Eloquent JavaScript_
29-
30-
- Objects continued: http://eloquentjavascript.net/06_object.html
31-
32-
3325
## Recommended readings
26+
These chapters from _Eloquent JavaScript_ are a bit advanced, but give in-depth explanations of the topics that will be discussed during the lecture. If you have the time, try giving these chapters a read.
3427

35-
This chapter from _Eloquent JavaScript_ gives in-depth explanations of the topics that will be discussed during the lecture. Highly recommended (if time permits).
28+
- Chapter 3 - [Functions](https://eloquentjavascript.net/03_functions.html)
29+
- Chapter 4 - [Data Structures: Objects and Arrays](https://eloquentjavascript.net/04_data.html)
30+
- Chapter 5 [Higher-Order Functions](https://eloquentjavascript.net/05_higher_order.html)
3631

37-
- Chapter 3 - [Functions](http://eloquentjavascript.net/03_functions.html)
38-
- Chapter 5 - [Higher-Order Functions](http://eloquentjavascript.net/05_higher_order.html)
32+
#### For fun
33+
[The Weird History of JavaScript](https://www.youtube.com/watch?v=Sh6lK57Cuk4) shows just how haphazard the evolution of Javascript actually was.
3934

4035
_Please go through the material and come to class prepared!_

Week2/homework/pokemon-data.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

Week2/homework/squirtle-sprites.js

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)