Easy approach
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```typescript []
class Calculator {
  private value: number; // Define the value as a private property

  constructor(value: number) {
    this.value = value; // Initialize the value in the constructor
  }

  add(value: number): Calculator {
    this.value += value;
    return this; // Return the instance for method chaining
  }

  subtract(value: number): Calculator {
    this.value -= value;
    return this; // Return the instance for method chaining
  }

  multiply(value: number): Calculator {
    this.value *= value;
    return this; // Return the instance for method chaining
  }

  divide(value: number): Calculator {
    if (value === 0) throw new Error("Division by zero is not allowed");
    this.value /= value;
    return this; // Return the instance for method chaining
  }

  power(value: number): Calculator {
    this.value = Math.pow(this.value, value); // Use Math.pow for power calculation
    return this; // Return the instance for method chaining
  }

  getResult(): number {
    return this.value; // Return the current value
  }
}

```
['TypeScript']