Advertisement
Guest User

Untitled

a guest
Jun 19th, 2016
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. "use strict";
  2.  
  3. module.exports = class Rectangle {
  4.     constructor(x, y, width, height) {
  5.         this.x = x;
  6.         this.y = y;
  7.         this.width = width;
  8.         this.height = height;
  9.     }
  10.  
  11.     get left() {
  12.         return this.x;
  13.     }
  14.  
  15.     get right() {
  16.         return this.x + this.width;
  17.     }
  18.  
  19.     get top() {
  20.         return this.y;
  21.     }
  22.  
  23.     get bottom() {
  24.         return this.y + this.height;
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement