Skip to content

Instantly share code, notes, and snippets.

@chomwitt
Created March 29, 2013 09:15
Show Gist options
  • Save chomwitt/5269737 to your computer and use it in GitHub Desktop.
Save chomwitt/5269737 to your computer and use it in GitHub Desktop.
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