Created
June 6, 2020 12:09
-
-
Save ispoljari/5c27bbaeeb994aeaba16d4f9301e527c to your computer and use it in GitHub Desktop.
Use of equational reasoning
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
| // step 1. | |
| const areCompatibleMatch = (mike, jane) => ( | |
| 'running' ==== 'running' || // ref. transparency | |
| 'pizza' ==== 'lasagne' ? // ref. transparency | |
| generateMessage("Mike", "Jane") : | |
| false; | |
| ); | |
| // step 2. | |
| const areCompatibleMatch = (mike, jane) => generateMessage("Mike", "Jane") | |
| // step 3. | |
| const areCompatibleMatch = (mike, jane) => "Congratulations Mike and Jane"; // ref. transparency | |
| areCompatibleMatch(mike, jane); // "Congratulations Mike and Jane |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment