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

Skip to content

Commit 16ca1e0

Browse files
authored
Update LESSONPLAN.md
1 parent f74695f commit 16ca1e0

File tree

1 file changed

+81
-8
lines changed

1 file changed

+81
-8
lines changed

Week3/LESSONPLAN.md

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,95 @@ The purpose of this class is to introduce to the student:
88
- Wat is scope (global, functional, block)
99
- How to combine variables, loops & functions
1010

11-
### Core concepts
11+
## Core concepts
1212

1313
FIRST HALF (12.00 - 13.30)
1414

15-
1. Q&A about last week's concepts & homework
15+
## 1. Q&A about last week's concepts & homework
1616

17-
2. What is a function (ES5 only)
17+
### Explanation
18+
### Example
19+
### Exercise
20+
### Essence
1821

19-
**Do Exercise**
22+
## 2. What is a function (ES5 only)
23+
24+
### Explanation
25+
Functions are a way to organize your code in to re-usable chunks.
26+
27+
> People think that computer science is the art of geniuses but the actual reality is the opposite, just many people doing things that build on each other, like a wall of mini stones.
28+
>
29+
> _-- Donald Knuth_
30+
31+
https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/functions.md
32+
### Example
33+
Same link as Explanation
34+
### Exercise
35+
https://github.com/yash-kapila/HYF-JS1-Week3/tree/master/src
36+
### Essence
37+
- __Reusability__: Functions can be grouped together to make a module (or library), and then modules can be imported into your application so you can build awesome apps!
38+
- __Abstraction__: Hide underlying details about how a piece of functionality works under the hood. You can change how things are implemented within the function without other programmers who use your function worrying aobut the exact details of how it was implemented.
39+
40+
And the same link as Explanation
2041

2142
SECOND HALF (14.00 - 16.00)
2243

23-
3. Wat is scope (global, functional, block)
44+
## 3. Wat is scope (global, functional, block)
45+
46+
### Explanation
47+
Scopes define the visiblity of declarations of variables and functions.
48+
49+
The top level outside all your functions is called the _global scope_. Values defined in the global scope are accessible from everywhere in the code.
50+
51+
- `var` and `function` declarations are visible with function scope.
52+
- `let` and `const` declarations are visible with block scope.
53+
54+
https://github.com/HackYourFuture/fundamentals/blob/master/fundamentals/scope.md
55+
### Example
56+
![Scopes](./assets/scopes.png)
57+
58+
```Javascript
59+
let villan = "Joker"; // | global scope
60+
// |
61+
function myFunction() { // | | function scope
62+
let hero = "Batman"; // | |
63+
if (hero === "Batman") { // | | | block scope
64+
let coHero = "Robin"; // | | |
65+
console.log(hero); // | | |
66+
console.log(coHero); // | | |
67+
console.log(villan); // | | |
68+
} // | | |
69+
console.log("------") // | |
70+
console.log(hero); // | |
71+
console.log(coHero); // | |
72+
console.log(villan); // | |
73+
} // | |
74+
// |
75+
myFunction(); // |
76+
```
77+
78+
And the same link as Explanation
79+
### Exercise
80+
What happens if we use the same variable name in different scopes?
81+
82+
```Javascript
83+
function myFunction() {
84+
let hero = "Batman";
85+
if (true) {
86+
let hero = "The Flash";
87+
console.log(hero);
88+
}
89+
console.log(hero);
90+
}
2491

25-
_Show examples_
92+
myFunction();
93+
```
94+
### Essence
95+
Same link as Explanation
2696

27-
4. How to combine variables, loops & functions
97+
## 4. How to combine variables, loops & functions
2898

29-
**Do Exercise**
99+
### Explanation
100+
### Example
101+
### Exercise
102+
### Essence

0 commit comments

Comments
 (0)