Skip to content

Instantly share code, notes, and snippets.

@weslleyaraujo
Created April 29, 2014 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weslleyaraujo/11389803 to your computer and use it in GitHub Desktop.
Save weslleyaraujo/11389803 to your computer and use it in GitHub Desktop.
var fn = function even (n) {
if (n === 0) {
return true
}
else return !even(n - 1)
}
fn(5);
//=> false
fn(2);
//=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment