{"ScriptPreparationCode":null,"TestCases":[{"Name":"ES6 Class","Code":"class Point {\r\n\tconstructor(x, y){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n }\r\n\r\n\tadd(point){\r\n\t\treturn new Point(this.x \u002B point.x, this.y \u002B point.y);\r\n }\r\n\r\n\tsub(point){\r\n\t\treturn new Point(this.x - point.x, this.y - point.y);\r\n }\r\n}\r\n\r\nvar p1 = new Point(10, 10);\r\nvar p2 = new Point(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Function Prototype","Code":"function Point(x, y){\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n}\r\n\r\nPoint.prototype.add = function(point){\r\n return new Point(this.x \u002B point.x, this.y \u002B point.y);\r\n}\r\n\r\nPoint.prototype.sub = function(point){\r\n\treturn new Point(this.x - point.x, this.y - point.y);\r\n}\r\n\r\nvar p1 = new Point(10, 10);\r\nvar p2 = new Point(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);\r\n","IsDeferred":false},{"Name":"Object Literal","Code":"function Point(x, y){\r\n\treturn {\r\n \tx, \r\n \ty, \r\n \tadd: (point)=\u003EPoint(this.x \u002B point.x, this.y \u002B point.y),\r\n\t \tsub: (point)=\u003EPoint(this.x - point.x, this.y - point.y)\r\n } \r\n}\r\n\r\nvar p1 = Point(10, 10);\r\nvar p2 = Point(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"Class extends","Code":"class Base {\r\n\tconstructor(x, y){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n }\r\n\r\n\r\n}\r\n\r\nclass Point extends Base{\r\n\r\n\tadd(point){\r\n\t\treturn new Point(this.x \u002B point.x, this.y \u002B point.y);\r\n }\r\n\r\n\tsub(point){\r\n\t\treturn new Point(this.x - point.x, this.y - point.y);\r\n }\r\n}\r\n\r\nvar p1 = new Point(10, 10);\r\nvar p2 = new Point(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false},{"Name":"class extends twce","Code":"class Base {\r\n\tconstructor(x, y){\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n }\r\n\r\n\r\n}\r\nclass Add extends Base {\r\n\tadd(point){\r\n\t\treturn new Point(this.x \u002B point.x, this.y \u002B point.y);\r\n }\r\n}\r\nclass Point extends Add{\r\n\tsub(point){\r\n\t\treturn new Point(this.x - point.x, this.y - point.y);\r\n }\r\n}\r\n\r\nvar p1 = new Point(10, 10);\r\nvar p2 = new Point(10, -10);\r\nvar sum = p1.add(p2);\r\nvar dif = p1.sub(p2);","IsDeferred":false}]}