Consolidate error checking into _check function#2546
Consolidate error checking into _check function#2546nafeesathraffa wants to merge 1 commit intodanthareja:nafeesathraffafrom
Conversation
Refactored error checking into a single _check function to reduce code duplication across arithmetic operations.
Thank you for the submission, @nafeesathraffa! I'll review your code shortly, hang tight. |
Refactored error checking into a single _check function to reduce code duplication across arithmetic operations.
Refactored duplicate type validation into a shared _check function.
New!Click to edition centralizes the error checking for 'x' and 'y' to ensure they are numbers.
Each arithmetic function now calls ''exports._check()" to avoid repeating the same validation logic and to keep the code DRY.