TS solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```typescript []\nclass Calculator {\n    res: number;\n    \n    constructor(value: number) {\n        this.res = value\n    }\n    \n    add(value: number): Calculator {\n        let calculatedValue = this.res += value\n        return new Calculator(calculatedValue)\n    }\n    \n    subtract(value: number): Calculator {\n        let calculatedValue = this.res -= value\n        return new Calculator(calculatedValue)\n    }\n    \n    multiply(value: number): Calculator {\n        this.res = this.res * value\n        return new Calculator(this.res)\n    }\n    \n    divide(value: number): Calculator {\n        if (value === 0) {\n            throw new Error(\'Division by zero is not allowed\')\n        } else {\n            this.res = this.res / value\n        }\n        \n        return new Calculator(this.res)\n    }\n    \n    power(value: number): Calculator {\n        this.res = this.res ** value\n        return new Calculator(this.res)\n    }\n    \n    getResult(): number {\n        return this.res\n    }\n}\n```
['TypeScript']