Created
May 19, 2018 17:21
-
-
Save khg0712/6209e81e9f8e2783da49d26a03993d58 to your computer and use it in GitHub Desktop.
this의 역할 예시
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var my = { | |
name: 'my', | |
sayName() { | |
console.log(this.name); | |
} | |
}; | |
var other = { | |
name: 'other' | |
}; | |
otherObject.sayName = myObeject.sayName; | |
myObject.sayName();//'my' 반환 | |
otherObject.sayName();//'other' 반환 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment