Solution for calculator with method chaining
Code\njavascript []\nclass Calculator {\n    constructor(initialValue = 0) {\n        this.result = initialValue;\n    }\n\n    add = (value) => {\n        this
# Code\n```javascript []\nclass Calculator {\n    constructor(initialValue = 0) {\n        this.result = initialValue;\n    }\n\n    add = (value) => {\n        this.result += value;\n        return this;\n    }\n\n    subtract = (value) => {\n        this.result -= value;\n        return this;\n    }\n\n    multiply = (value) => {\n        this.result *= value;\n        return this;\n    }\n\n    divide = (value) => {\n        if (!value) throw new Error("Division by zero is not allowed");\n        this.result /= value;\n        return this;\n    }\n\n    // Method to raise the result to the power of a number\n    power = (value) => {\n        this.result = Math.pow(this.result, value);\n        return this;\n    }\n\n    // Method to get the current result\n    getResult = () => this.result;\n}\n```
['JavaScript']