Skip to content

Commit c4b4364

Browse files
committed
Answered question 4 in part 1 of this.js
1 parent ef1bb3e commit c4b4364

1 file changed

Lines changed: 5 additions & 13 deletions

File tree

‎this.js‎

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,17 @@
44
* 1. Window Binding: In this case 'this' is usually the window object that executes you code. Ultimately it binds to the global object.
55
* 2. Implicit Binding: When applying a method 'this' pertains to what is left of the dot.
66
* 3. New Binding: When creating something using the 'new' keyword 'this' related to the newly created data.
7-
* 4.
7+
* 4. Explicit Binding: This type ofbinding happens when using .call() and .apply(). This is very similar to implicit binding but essentially reorients the focus of 'this'.
88
*
99
* write out a code example of each explanation above
1010
*/
1111

1212
console.log('hello world!');
1313

14-
// Principle 1
14+
// Principle 1: code example for Window Binding
1515

16-
// code example for Window Binding
16+
// Principle 2: code example for Implicit Binding
1717

18-
// Principle 2
18+
// Principle 3: code example for New Binding
1919

20-
// code example for Implicit Binding
21-
22-
// Principle 3
23-
24-
// code example for New Binding
25-
26-
// Principle 4
27-
28-
// code example for Explicit Binding
20+
// Principle 4: code example for Explicit Binding

0 commit comments

Comments
 (0)