Created
February 1, 2016 06:34
-
-
Save stefanfrede/e6734dff0d1b6693b2bb to your computer and use it in GitHub Desktop.
Convert a truthy or falsy value to true boolean with the !! operator.
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
!!"" // false | |
!!0 // false | |
!!null // false | |
!!undefined // false | |
!!NaN // false | |
!!"hello" // true | |
!!1 // true | |
!!{} // true | |
!![] // true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment