Skip to content

Instantly share code, notes, and snippets.

@marsrvr
Created March 20, 2019 23:24
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 marsrvr/19bcc39eb6a433d73969d6443a0ebbd1 to your computer and use it in GitHub Desktop.
Save marsrvr/19bcc39eb6a433d73969d6443a0ebbd1 to your computer and use it in GitHub Desktop.
IvanOnTech Academy Smart Contract Programming Eloquent JavaScript Chapter 3 Exercises: recursive isEven( )
function isEven(n) {
if (n == 0) return true;
if (n == 1) return false;
if (n < 0) return isEven(-n);
return isEven(n - 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment