Last active
August 14, 2019 22:14
-
-
Save gjgd/dd6a20554bd3efa5451158a878891d75 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
// Add two numbers | |
const add = (a, b) => { | |
return a + b; | |
}; | |
// Subtract two numbers | |
const subtract = (a, b) => { | |
return a - b; | |
}; | |
// Multiply two numbers | |
const multiply = (a, b) => { | |
return a * b; | |
}; | |
// Divide two numbers | |
const divide = (a, b) => { | |
if (b === 0) { | |
throw new Error('Cannot divide by 0'); | |
} | |
return a / b; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment