Created
January 12, 2018 13:24
-
-
Save jooyunghan/0b96c2edeaabbae8913e9d4ef4b390ad to your computer and use it in GitHub Desktop.
상호재귀 stackoverflow even/odd
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
| function even(n) { | |
| if (n === 0) return true; | |
| else return odd(n-1); | |
| } | |
| function odd(n) { | |
| if (n === 0) return false; | |
| else return even(n-1); | |
| } | |
| console.log(even(100000)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment