{"ScriptPreparationCode":null,"TestCases":[{"Name":"class","Code":"class CowClass {\r\n constructor(lungCapacity) {\r\n this.lungCapacity = lungCapacity\r\n this.airInLungs = 0\r\n }\r\n getAirInLungs() {\r\n return this.airInLungs\r\n }\r\n breathe () {\r\n this.airInLungs = this.lungCapacity\r\n }\r\n moo () {\r\n let output = \u0027m\u0027\r\n let air = this.getAirInLungs()\r\n while (air --\u003E 0) { // The \u0027goes to\u0027 operator\r\n output \u002B= \u0027o\u0027\r\n }\r\n this.airInLungs = air\r\n return output\r\n }\r\n}\r\n\r\nconst cow = new CowClass(3000)\r\ncow.breathe()\r\ncow.moo()","IsDeferred":false},{"Name":"closure","Code":"function CowClosure(lungCapacity) {\r\n let airInLungs = 0\r\n function breathe () {\r\n airInLungs = lungCapacity\r\n }\r\n function getAirInLungs () {\r\n return airInLungs\r\n }\r\n function moo () {\r\n let output = \u0027m\u0027\r\n let air = getAirInLungs()\r\n while (air --\u003E 0) { // The \u0027goes to\u0027 operator.df\r\n output \u002B= \u0027o\u0027\r\n }\r\n airInLungs = air\r\n return output\r\n }\r\n return {breathe:breathe, moo:moo}\r\n}\r\n\r\n\r\nconst cow = CowClosure(3000)\r\ncow.breathe()\r\ncow.moo()","IsDeferred":false}]}