Skip to content

Instantly share code, notes, and snippets.

@cziem
Created September 15, 2018 23:01
Show Gist options
  • Save cziem/84325a35688b83a680fabf809824fec7 to your computer and use it in GitHub Desktop.
Save cziem/84325a35688b83a680fabf809824fec7 to your computer and use it in GitHub Desktop.
Operations.js
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