Simple solution, you need to know only this
Complexity\n- Time complexity: O(1)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: O(1)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```typescript []\nclass Calculator {\n    private value = 0\n    constructor(value: number) {\n        this.value = value\n    }\n    \n    add(value: number): Calculator {\n        this.value += value\n        return this\n    }\n    \n    subtract(value: number): Calculator {\n        this.value -= value\n        return  this\n    }\n    \n    multiply(value: number): Calculator {\n        this.value *= value\n        return  this\n    }\n    \n    divide(value: number): Calculator {\n        if(!value)\n        throw "Division by zero is not allowed"\n\n        this.value /= value\n        return  this\n    }\n    \n    power(value: number): Calculator {\n        this.value = Math.pow(this.value, value)\n        return this\n    }\n    \n    getResult(): number {\n        return this.value\n    }\n}\n```
['TypeScript']