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
{{ message }}
Repository navigation
Commit b16ec3a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: assignments/this.js
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -26,12 +26,28 @@ const impliciturBinder = {
26
26
}
27
27
}
28
28
29
-
impliciturBinder.findFave();
29
+
impliciturBinder.findFave();// shows that "this" in findFave is implciitly bound to impliciturBinder
30
30
31
31
32
32
// Principle 3
33
33
34
34
// code example for New Binding
35
+
functionCoolGuy(name,pet,artist){
36
+
this.name=name;
37
+
this.pet=pet;
38
+
this.artist=artist;
39
+
this.hobby="skateboarding";
40
+
this.girlfriend="Gal Gadot";
41
+
this.car="Lambo";
42
+
this.currency="Dogecoin";
43
+
this.describer=function(){
44
+
console.log(`I am a cool guy named ${this.name}. I own a ${this.pet} and my favorite artist is ${this.artist}. I enjoy ${this.hobby}. My girlfriend is ${this.girlfriend}. I drive a ${this.car}. I keep my money in ${this.currency}`)
0 commit comments