Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "use strict";
- var _prototypeProperties = function (child, staticProps, instanceProps) {
- if (staticProps) Object.defineProperties(child, staticProps);
- if (instanceProps) Object.defineProperties(child.prototype, instanceProps);
- };
- var Person = (function () {
- function Person(firstName, lastName) {
- this.firstName = firstName;
- this.lastName = lastName;
- }
- _prototypeProperties(Person, null, {
- name: {
- get: function () {
- return this.firstName + " " + this.lastName;
- },
- set: function (name) {
- var names = name.split(" ");
- this.firstName = names[0];
- this.lastName = names[1];
- },
- configurable: true
- }
- });
- return Person;
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement