igrilkul

Untitled

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