Created
August 12, 2018 06:35
-
-
Save jaamaalxyz/eb94d92628aff597c5c7f1628c6c35c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const add = (x, y) => (+x) + (+y); | |
| const subtract = (x, y) => (+x) - (+y); | |
| const multiply = (x, y) => (+x) * (+y); | |
| const divide = (x, y) => (+x) / (+y); | |
| // Input validation function | |
| const validateNumbers = (x, y) => { | |
| if (isNaN(x) || isNaN(y)) { | |
| return false; | |
| } | |
| return true; | |
| } | |
| module.exports = { | |
| add, | |
| subtract, | |
| multiply, | |
| divide, | |
| validateNumbers, | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment