Last active
August 20, 2022 10:12
-
-
Save EteimZ/a5681fcc2099d65066b2c106a839105d to your computer and use it in GitHub Desktop.
The gist contains snippets of rambda.js code.
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 R = require("rambda"); | |
| // Get the nth fibonacci number | |
| const nthFib = R.cond([ | |
| [R.equals(1), R.always(1)], | |
| [R.equals(2), R.always(1)], | |
| [R.T, n => nthFib(n-1) + nthFib(n-2)] | |
| ]); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment