Created
March 29, 2013 09:15
-
-
Save chomwitt/5269737 to your computer and use it in GitHub Desktop.
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
Object.defineProperty(person, 'name', { get: get_full_name | |
, set: set_full_name | |
, configurable: true | |
, enumerable: true }); | |
person.greet = function (person) { | |
return this.name + ': hello there, ' + person + '.' ; | |
} | |
var alexandros = Object.create(person) ; | |
alexandros.first_name = 'Alexandros' ; | |
alexandros.last_name = 'Prekates' ; | |
alexandros.name = 'Alexander Great!'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment