Created
August 26, 2017 00:51
-
-
Save YKalashnikov/e9f85632dbfc1a0fd704e474319e38df to your computer and use it in GitHub Desktop.
Boo who FreeCodeCamp.com
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 booWho(bool) { | |
// the fastet way to solve this problem | |
return typeof bool==="boolean"; | |
} | |
booWho(null); | |
/* another way to solve it | |
function booWho(bool) { | |
if (bool===true || bool===false){ | |
return true; | |
} | |
else{ | |
return false; | |
} | |
return bool; | |
} | |
booWho(false); | |
*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment