{"ScriptPreparationCode":"function Shape() {}\r\nfunction Circle() {}\r\nCircle.prototype = new Shape();\r\n\r\nfunction Square() {}\r\nSquare.prototype = new Shape()\r\n\r\nfunction Rectangle () {}\r\nRectangle.prototype = new Square();\r\n\r\nfunction circle() {\r\n return { kind: 0 };\r\n}\r\n\r\nfunction isCircle(t) {\r\n return t.kind === 0;\r\n}\r\n\r\nfunction square() {\r\n return { kind: 1 }\r\n}\r\n\r\nfunction isSquare(t) {\r\n return t.kind === 1;\r\n}\r\n\r\nfunction rectangle() {\r\n return { kind: 2 }\r\n}\r\n\r\nfunction isRectangle(t) {\r\n return t.kind === 2;\r\n}\r\n\r\n","TestCases":[{"Name":"Classes","Code":"const c = new Circle();\r\nconst s = new Square();\r\nconst r = new Rectangle();\r\nconsole.log(c instanceof Circle);\r\nconsole.log(c instanceof Square);\r\nconsole.log(s instanceof Circle);\r\nconsole.log(s instanceof Square);\r\nconsole.log(r instanceof Rectangle);","IsDeferred":false},{"Name":"Union","Code":"const c = circle();\r\nconst s = square();\r\nconst r = rectangle();\r\nconsole.log(isCircle(c));\r\nconsole.log(isSquare(c));\r\nconsole.log(isCircle(s));\r\nconsole.log(isSquare(s));\r\nconsole.log(isRectangle(r));","IsDeferred":false}]}