Created
February 11, 2018 22:23
-
-
Save ealush/e4d4f00c6f29212818eba15cbe0bc9cd 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
| // 1: accepts a value | |
| enforce(1) | |
| // 2: returns an object | |
| { | |
| isNumber: // func, | |
| largerThan: // func, | |
| ... | |
| } | |
| // 3: has the function aware of the initial value | |
| enforce(1).largerThan(3) // = (number, initial) => number < initial | |
| // 4: throw on false | |
| throw new Error() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment