Skip to content

Instantly share code, notes, and snippets.

@singerxt
Created February 24, 2015 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save singerxt/c0e84076c66d9b4d46cc to your computer and use it in GitHub Desktop.
Save singerxt/c0e84076c66d9b4d46cc to your computer and use it in GitHub Desktop.
var woman = new Person('Kate', 'Khowalski');
woman.firstName; // 'Kate'
woman.lastName; // 'Khowalski'
woman.fullName; //'Kate Khowalski
woman.species; // human
/*
* Change firstName
*/
woman.firstName = 'Yulia';
woman.firstName; // 'Yulia'
woman.lastName; // 'Khowalski'
woman.fullName; // 'Yulia Khowalski' - How to do that !?
woman.species = 'fish';
woman.species; // human - No, you can't change this property.
/*
* Change fullName
*/
woman.fullName = 'Joana Stevens';
woman.firstName; //Joana
woman.lastName; //Stevens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment