You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,30 @@
12
12
* In class we will be going over the principles listed above and you will be expected to follow along when the instructor asks you to do so.
13
13
14
14
### Recursion
15
+
#### What it is
15
16
* recursion is another way to represent a looping program.
16
17
* Simliar to a `for loop` or a `while loop` a recursive function will loop until you tell it to stop.
17
18
* when solving complex algorithms recursion comes in handy. It is not that great for smaller, less complex algorithms.
18
-
* For every recursive function, you'll need to establish what is called a `base case`. A `base case` is a condition that when triggered, will discontinue the call to your function.
19
+
* For every recursive function, you'll need to establish what is called a `base case`. A `base case` is a condition that when triggered, will discontinue the call to your function.
20
+
21
+
### The "this keyword
22
+
* Because JavaScript is both an Object Oriented and Functional Programming language, it has some very interesting concepts built into it.
23
+
* The 'this' keyword is one of those querky concepts that tend to trip up a lot of people coming into JavaScript.
24
+
* You can think of this, as a Pointer to an object. For example, you can use the this keyword to reference an object without having to refer to that object's name.
25
+
***example**
26
+
```
27
+
const myObj = {
28
+
name: 'Freddy'
29
+
greet: function() {
30
+
console.log(`hello my name is ${this.name}`);
31
+
}
32
+
};
33
+
myObj.greet();
34
+
```
35
+
* In the above example the "this" keyword becomes active when a person's name is called.
36
+
* Tyler McGinnis' four rules to the 'this' keyword. [found here](https://www.youtube.com/watch?v=zE9iro4r918)
0 commit comments