Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding Functions lecture notes
  • Loading branch information
Gabe Rodriguez authored and kvarak committed Jun 28, 2019
commit 7d6c81bb949360a66de105b6ff5ab2443c84c96d
39 changes: 24 additions & 15 deletions Week2/LECTURENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,29 @@ Cover individual topics that students may still be stuck on from previous lectur
* protobufs
* XML
* GRPC?!



## Functions + JSON

## Higher order functions
## Arrow functions



* Cover homework question #3

## Functions advanced (12-12:30pm)
* Different ways functions can be made:
* function declaration vs expression
* arrow function
* Omitting return, parameter parenthesis
* What's a method?
* Pure function? or side effects?
* Example: how does a program run this? (example w/ a function, call of that function, and a console log)
* Call stack (stack overflow)
* Params
* Extra params
* Default params
* Recursion (basic example)
* Example function
* pigs example?
* countChar("kakkerlak", "k")? With DOM manipulation?
* Simplicity of functions
* while loop from [Chapter 5](http://eloquentjavascript.net/05_higher_order.html)
* Higher order functions
* repeat(n, action)
* greaterThan10

## Array Manipulations
## Map and filter
## Reduce (every?)

## Discuss Homework (20mins)

## Map, Filter, Reduce (others? every, some, etc)
25 changes: 13 additions & 12 deletions Week2/MAKEME.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@

```
Topics discussed this week:
• Functions + JSON/Arrays
• Array Manipulations
• JSON
• Map and filter
• Arrow functions
• Functions advanced
• Array Manipulations
• Map, filter, & reduce
```

> [Here](/Week3/README.md) you find the readings you have to complete before the third lecture.

## Step 0: JSON parsing
1. Create an HTML file
2. Insert a script tag that points to squirtle-sprites.js
3. In squirtle-sprites.js, convert pokemonDataJSONString to a javascript object so you can access its properties
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?)
*Bonus Challenge*: Can you use an array method to loop over all sprites so you don't have to manually type each?

## Step 1: More map, filter and `=>`

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

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

## Step 3: ROVER
## Step 3: JSON parsing

1. Create an HTML file
2. Insert a script tag that points to squirtle-sprites.js
3. In squirtle-sprites.js, call fetchPokemonData() and convert the JSON string it returns to a javascript object so you can access its properties
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?)
*Bonus Challenge*: Can you use an array method to loop over all sprites so you don't have to manually type each?

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

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

- [Handing in homework](https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/homework_pr.md)

### Do you have even more time?
Read the _Eloquent Javascript_ chapters in the [Week 2 Readme](./README.md)
27 changes: 11 additions & 16 deletions Week2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,32 @@

```
In week two we will discuss the following topics:
• Functions + JSON/Arrays
• Array Manipulations
• JSON
• Map and filter
• Arrow functions
• Functions advanced
• Array Manipulations
• Map, filter, & reduce
```

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

### JSON
- [JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON) (MDN)
- [FreeCodeCamp JSON](https://www.youtube.com/watch?v=B-k76DMOj2k)
- [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)

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

### Code conventions
- Code conventions: http://crockford.com/javascript/code.html

### Array cardio
- Wes Bos' awesome free tutorials. Just make a free account and do Array Cardio #1 [here](https://javascript30.com/)

### From _Eloquent JavaScript_

- Objects continued: http://eloquentjavascript.net/06_object.html


## Recommended readings
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.

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

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

_Please go through the material and come to class prepared!_
2 changes: 0 additions & 2 deletions Week2/homework/pokemon-data.js

This file was deleted.

17 changes: 9 additions & 8 deletions Week2/homework/squirtle-sprites.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.