Created
January 6, 2016 16:46
-
-
Save anonymous/8918b832d66a98cd3b76 to your computer and use it in GitHub Desktop.
This file contains 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 firstName = 'Hoang', lastName = 'Pham'; | |
// 2 biến này nằm trong object window | |
function showName() | |
{ | |
console.log(this.firstName + ' '+ this.lastName); | |
} | |
window.showName(); // Hoang Pham. this trỏ tới object window | |
showName(); //Hoang Pham. Object gọi hàm showName vẫn là object window |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment