Skip to content

Commit 1ea6c12

Browse files
committed
Coded principle 2 in this.js
1 parent 5041958 commit 1ea6c12

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎this.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ function logWindow() {
1717
}
1818

1919
// Principle 2: code example for Implicit Binding
20+
const bob = {
21+
name: 'Bob',
22+
23+
sayName() {
24+
console.log(this.name);
25+
}
26+
}
2027

2128
// Principle 3: code example for New Binding
2229

0 commit comments

Comments
 (0)