{"ScriptPreparationCode":"class Point {\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 Point(this.x \u002B point.x, this.y \u002B point.y);\r\n }\r\n\r\n sub(point) {\r\n return new Point(this.x - point.x, this.y - point.y);\r\n }\r\n}\r\nvar Point1 = Point;\r\n\r\nfunction Point2(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n}\r\nPoint2.prototype.add = function(point) {\r\n return new Point2(this.x \u002B point.x, this.y \u002B point.y);\r\n}\r\n\r\nPoint2.prototype.sub = function(point) {\r\n return new Point2(this.x - point.x, this.y - point.y);\r\n}\r\n\r\nfunction Point3(x, y) {\r\n return {\r\n x,\r\n y,\r\n add: (point) =\u003E Point3(this.x \u002B point.x, this.y \u002B point.y),\r\n sub: (point) =\u003E Point3(this.x - point.x, this.y - point.y)\r\n }\r\n}","TestCases":[{"Name":"ES6 Class","Code":"var p1 = new Point1(10, 10);\r\nvar p2 = new Point1(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Function Prototype","Code":"var p1 = new Point2(10, 10);\r\nvar p2 = new Point2(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Object Literal","Code":"var p1 = Point3(10, 10);\r\nvar p2 = Point3(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false}]}