javascript-mini-projects icon indicating copy to clipboard operation
javascript-mini-projects copied to clipboard

Input Validation and Error Handling

Open MakaremHind opened this issue 11 months ago • 0 comments

Description:

This pull request adds important input validation checks to improve the robustness and user experience of the calculator application. The following enhancements were implemented:

  • Prevent Multiple Decimal Points:

    Prevents users from entering multiple decimal points within a single number, which could lead to invalid inputs or parsing errors.

  • Prevent Consecutive Operators:

    Prevents users from adding two operators consecutively.

  • Division by Zero Check:

    Adds validation to handle division by zero, displaying an error message when a user attempts to divide by zero.

The code is now more resilient to unexpected user inputs, providing a smoother and more reliable user experience.

MakaremHind avatar Nov 15 '24 00:11 MakaremHind