Last active
May 19, 2016 10:58
-
-
Save antic183/5df12e622ea3b92dd508 to your computer and use it in GitHub Desktop.
is number even or odd
This file contains 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 isEven(number) { | |
return !(number & 1); | |
} | |
function isOdd(number) { | |
return !!(number & 1); | |
} | |
isOdd(5); // true | |
isOdd(6); // false | |
isEven(4); // true | |
isEven(5); // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment