Created
July 15, 2014 20:16
-
-
Save kaiquewdev/234d24d581990b7937b8 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
| var userComponent = { | |
| fullName: function () { return this.firstName + ' ' + this.lastName; }, | |
| get: function (key, value) { return this[key] || (value || ''); }, | |
| }; | |
| var evandro = Object.create(userComponent, { | |
| 'firstName': { value: 'Evandro', enumerable: false }, | |
| 'lastName': { value: 'Ribeiro', enumerable: false } | |
| }); | |
| console.log(evandro.fullName()); | |
| console.log(evandro.get('firstName')); | |
| console.log(evandro.get('lastName')); | |
| console.log(evandro); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment