Advertisement
Guest User

function

a guest
Feb 19th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Rect_1(x, y) {
  2.     this._x = x;
  3.     this._y = y;
  4.    
  5.     /*this.setX = (value) => {
  6.         this._x = value;
  7.     };
  8.     this.getX = () => {
  9.         return this._x;
  10.     };*/
  11. }
  12.  
  13. Rect_1.prototype.setY = function(value) {
  14.     this._y = value;
  15. }
  16.  
  17. Rect_1.prototype.getY = function() {
  18.     return this._y;
  19. }
  20.  
  21. Object.defineProperty(Rect_1.prototype, "y", {
  22.     get: Rect_1.prototype.getY,
  23.     set: Rect_1.prototype.setY
  24. })
  25.  
  26. Rect_1.prototype.setX = function(value) {
  27.     this._x = value;
  28. }
  29.  
  30. Rect_1.prototype.getX = function() {
  31.     return this._x;
  32. }
  33.  
  34. Object.defineProperties(Rect_1.prototype, {
  35.     "x": {
  36.         get: Rect_1.prototype.getX,
  37.         set: Rect_1.prototype.setX
  38.     }
  39. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement