Last active
November 20, 2018 18:59
-
-
Save filipesperandio/09d30ee5e46ed0c7f94ea3a96c76d82d 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 validate(isValid) { return isValid || !isValid } | |
undefined | |
> validate(true) | |
true | |
> validate(false) | |
true | |
> validate(undefined) | |
true | |
> validate(null) | |
true | |
> validate(1) | |
1 | |
> validate(0) | |
true | |
> validate("a") | |
'a' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment