diff --git a/manual-testing-sandbox/test.js b/manual-testing-sandbox/test.js index 0e60af4e0..44c55402e 100644 --- a/manual-testing-sandbox/test.js +++ b/manual-testing-sandbox/test.js @@ -1,50 +1,23 @@ -/** - * Calculator class for performing basic arithmetic operations - * Uses method chaining to allow consecutive operations - */ class Calculator { - /** - * Initialize calculator with result set to 0 - */ constructor() { this.result = 0; } - /** - * Add a number to the current result - * @param {number} number - The number to add - * @returns {Calculator} - Returns this instance for method chaining - */ add(number) { this.result += number; return this; } - /** - * Subtract a number from the current result - * @param {number} number - The number to subtract - * @returns {Calculator} - Returns this instance for method chaining - */ subtract(number) { + this.result -= number; return this; } - /** - * Multiply the current result by a number - * @param {number} number - The number to multiply by - * @returns {Calculator} - Returns this instance for method chaining - */ multiply(number) { this.result *= number; return this; } - /** - * Divide the current result by a number - * @param {number} number - The number to divide by - * @returns {Calculator} - Returns this instance for method chaining - * @throws {Error} - Throws error if attempting to divide by zero - */ divide(number) { if (number === 0) { throw new Error("Cannot divide by zero"); @@ -53,18 +26,10 @@ class Calculator { return this; } - /** - * Get the current result value - * @returns {number} - The current result - */ getResult() { return this.result; } - /** - * Reset the result to 0 - * @returns {Calculator} - Returns this instance for method chaining - */ reset() { this.result = 0; return this;