Created
June 16, 2017 09:10
-
-
Save negativo/fcaf67d89bc641f6dca71c968a1a3336 to your computer and use it in GitHub Desktop.
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 evalBool(str){ | |
if( str[0] === 't' && | |
str[1] === 'r' && | |
str[2] === 'u' && | |
str[3] === 'e' | |
){ | |
return true; | |
} | |
if( str[0] === 'f' && | |
str[1] === 'a' && | |
str[2] === 'l' && | |
str[3] === 's' && | |
str[4] === 'e' | |
){ | |
return false; | |
} | |
if( str[0] === 'n' && | |
str[1] === 'u' && | |
str[2] === 'l' && | |
str[3] === 'l' | |
){ | |
return null; | |
} | |
return undefined; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment