Last active
March 16, 2016 23:49
-
-
Save stavros-zavrakas/dd8e1209c2cdfb181d76 to your computer and use it in GitHub Desktop.
Javascript object
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 person = { | |
firstName: 'firstName', | |
lastName: 'lastName', | |
greet: function () { | |
return 'Hi ' + this.firstName | |
} | |
}; | |
var stavros = Object.create(person); | |
stavros.firstName = 'Stavros'; | |
stavros.lastName = 'Zavrakas'; | |
stavros.greet(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment