Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve()
- {
- class Balloon {
- constructor(color, gasWeight) {
- this.color = color;
- this.gasWeight = Number(gasWeight);
- }
- }
- class PartyBalloon extends Balloon {
- constructor(color,gasWeight,ribbonColor, ribbonLength) {
- super();
- this.ribbonColor = ribbonColor;
- this.ribbonLength = Number(ribbonLength);
- this.ribbon = {
- color: this.ribbonColor,
- length: this.ribbonLength
- };
- }
- get ribbon() {
- return this._ribbon;
- }
- set ribbon(ribbon) {
- this._ribbon=ribbon;
- }
- }
- class BirthdayBalloon extends PartyBalloon {
- constructor(color,gasWeight,ribbonColor, ribbonLength,text) {
- super();
- this.text = text;
- }
- get text() {
- return this._text;
- }
- }
- return {
- Balloon: Balloon,
- PartyBalloon: PartyBalloon,
- BirthdayBalloon: BirthdayBalloon
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment