Advertisement
kstoyanov

02. Balloons

Oct 16th, 2020
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve() {
  2.     class Balloon {
  3.         constructor(color, gasWeight) {
  4.             this.color = color;
  5.             this.gasWeight = gasWeight;
  6.         }
  7.     }
  8.  
  9.     class PartyBalloon extends Balloon {
  10.         constructor(color, gasWeight, ribbonColor, ribbonLength) {
  11.             super(color, gasWeight);
  12.             this._ribbon = {color: ribbonColor, length: ribbonLength};
  13.         }
  14.  
  15.         get ribbon() {
  16.             return this._ribbon;
  17.         }
  18.     }
  19.  
  20.     class BirthdayBalloon extends PartyBalloon {
  21.         constructor(color, gasWeight, ribbonColor, ribbonLength, text) {
  22.             super(color, gasWeight, ribbonColor, ribbonLength);
  23.             this._text = text;
  24.         }
  25.  
  26.         get text() {
  27.             return this._text;
  28.         }
  29.     }
  30.  
  31.     return {
  32.         Balloon,
  33.         PartyBalloon,
  34.         BirthdayBalloon
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement