Created
September 30, 2021 14:17
-
-
Save jmaicaaan/c2a6f4a0a8b1354ba46f5d394511697b 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 sum = (x, y) => x + y; | |
/** | |
* We are sure that `sum(3, 3)` will *always* return `6` | |
* because the function `sum` is *pure*. | |
* No matter how many times we call it with the same input, | |
* it will produce the same output | |
*/ | |
const six = sum(3, 3); | |
console.log('six', six); // 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment