-
-
Save conanak99/9695e3a6469a499854e2 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
function Person(firstName, lastName) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
} | |
Person.prototype.love = function() { console.log('XXX') }; | |
var otherPerson = new Person('Hoang', 'Pham'); // object này có prototype là Person.prototype | |
otherPerson.love(); // XXX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment