Created
September 15, 2018 23:01
-
-
Save cziem/84325a35688b83a680fabf809824fec7 to your computer and use it in GitHub Desktop.
Operations.js
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 substract = (x, y) => (+x) - (+y); | |
const multiply = (x, y) => (+x) * (+y); | |
const divide = (x, y) => (+x) / (+y); | |
const validateNumbers = (x, y) => { | |
if (isNaN(x) || isNaN(y)) { | |
return false; | |
} | |
return true | |
} | |
module.exports = { | |
add, | |
substract, | |
divide, | |
multiply, | |
validateNumbers | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment