Created
October 10, 2017 17:30
-
-
Save fdjones/a85b5d981839188e6e404db9126630d4 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: just returns undefined | |
function isEven(num) { | |
if(num === 0) { | |
return true; | |
} | |
else if(num === 1) { | |
return false; | |
} | |
else { | |
isEven(num - 2); | |
} | |
} | |
// 2: works? | |
function isEvenss(num) { | |
if(num === 0) { | |
console.log('true'); | |
} | |
else if(num === 1) { | |
console.log('false'); | |
} | |
else { | |
isEvenss(num - 2); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment