Simple solution
\n# Code\ntypescript []\nclass Calculator {\n    private result: number;\n    constructor(value: number) {\n        this.result = value;\n    }\n    \n    add(v
\n# Code\n```typescript []\nclass Calculator {\n    private result: number;\n    constructor(value: number) {\n        this.result = value;\n    }\n    \n    add(value: number): Calculator {\n        this.result += value;\n        return this;\n    }\n    \n    subtract(value: number): Calculator {\n        this.result -= value;\n        return this;\n    }\n    \n    multiply(value: number): Calculator {\n        this.result *= value;\n        return this;\n    }\n    \n    divide(value: number): Calculator {\n        if(value == 0) throw new Error("Division by zero is not allowed");\n        this.result /= value;\n        return this;\n    }\n    \n    power(value: number): Calculator {\n        if (value === 0){\n            this.result = 1;\n            return this;\n        }\n\n        const base = this.result;\n        const isNegativeExponent = value < 0; // Track if exponent is negative\n\n        this.result = 1; // Start with neutral multiplier for powers\n\n        for (let i = 0; i < Math.abs(value); i++) {\n            this.result *= base;\n        }\n\n        if (isNegativeExponent) {\n            this.result = 1 / this.result; // For negative exponents, take reciprocal\n        }\n            return this;\n    }\n    \n    getResult(): number {\n        return this.result;\n    }\n}\n```
['TypeScript']