Created
March 22, 2013 16:43
-
-
Save brunobord/5222825 to your computer and use it in GitHub Desktop.
JS Boolean - WAT
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
var my_true = Boolean("true"); // == true | |
var my_false = Boolean("false"); // == true // WTF? | |
var my_question = Boolean("what's the bloody point of the Boolean() function?"); // == true // WAT | |
//Solution: | |
var ok = JSON.parse("true"); // == true | |
var ko = JSON.parse("false"); // == false | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment