Created
June 9, 2016 16:00
-
-
Save MichaelQQ/4d0d89f645c14ebece139b499c69d025 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 afib = f => n => { | |
if (n < 2) { | |
return 1; | |
} | |
return f(n -1) + f(n - 2); | |
} | |
//or | |
const afib = f => n => n < 2 ? 1 : f(n - 1) + f(n - 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment