{"ScriptPreparationCode":null,"TestCases":[{"Name":"Es6 Class","Code":"class Es6Point {\r\n constructor(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n\r\n add(point) {\r\n return new Es6Point(this.x \u002B point.x, this.y \u002B point.y);\r\n }\r\n\r\n sub(point) {\r\n return new Es6Point(this.x - point.x, this.y - point.y);\r\n }\r\n}\r\n\r\nconst p1 = new Es6Point(10, 10);\r\nconst p2 = new Es6Point(10, -10);\r\nconst sum = p1.add(p2);\r\nconst dif = p1.sub(p2);","IsDeferred":false},{"Name":"Prototype","Code":"function ProtoPoint(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n}\r\n\r\nProtoPoint.prototype.add = function(point) {\r\n return new ProtoPoint(this.x \u002B point.x, this.y \u002B point.y);\r\n}\r\n\r\n\r\nProtoPoint.prototype.sub = function(point) {\r\n return new ProtoPoint(this.x - point.x, this.y - point.y);\r\n}\r\n\r\nconst p1 = new ProtoPoint(10, 10);\r\nconst p2 = new ProtoPoint(10, -10);\r\nconst sum = p1.add(p2);\r\nconst dif = p1.sub(p2);","IsDeferred":false},{"Name":"Module","Code":"const ModulePoint = (x, y) =\u003E ({\r\n add: point =\u003E ModulePoint(x \u002B point.x, y \u002B point.y),\r\n sub: point =\u003E ModulePoint(x - point.x, y - point.y)\r\n})\r\n\r\nconst p1 = ModulePoint(10, 10)\r\nconst p2 = ModulePoint(10, -10)\r\nconst sum = p1.add(p2)\r\nconst dif = p1.sub(p2)","IsDeferred":false}]}