Simple TS / JS implementation
TypeScript\n\nclass Calculator {\n  private result: number\n\n  constructor(value : number) {\n      this.result = value\n  }\n    \n  add(value : number) : Cal
## TypeScript\n```\nclass Calculator {\n  private result: number\n\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)\n      throw new Error("Division by zero is not allowed");\n      \n    this.result /= value\n    return this\n  }\n    \n  power(value : number) : Calculator {\n    this.result = Math.pow(this.result, value)\n    return this\n  }\n\n  getResult() : number {\n    return this.result\n  }\n}\n```\n\n## JavaScript\n```\nclass Calculator {\n  \n  /** \n   * @param {number} value\n   */\n  constructor(value) {\n    this.result = value\n  }\n\n  /** \n   * @param {number} value\n   * @return {Calculator}\n   */\n  add(value){\n    this.result += value\n    return this\n  }\n\n  /** \n   * @param {number} value\n   * @return {Calculator}\n   */\n  subtract(value){\n    this.result -= value\n    return this\n  }\n\n  /** \n   * @param {number} value\n   * @return {Calculator}\n   */  \n  multiply(value) {\n    this.result *= value\n    return this\n  }\n\n  /** \n   * @param {number} value\n   * @return {Calculator}\n   */\n  divide(value) {\n    if (value == 0)\n      throw new Error("Division by zero is not allowed");\n      \n    this.result /= value\n    return this\n  }\n  \n  /** \n   * @param {number} value\n   * @return {Calculator}\n   */\n  power(value) {\n    this.result = Math.pow(this.result, value)\n    return this\n  }\n    \n  /** \n   * @return {number}\n   */\n  getResult() {\n    return this.result\n  }\n}\n```
['TypeScript', 'JavaScript']