Created
October 1, 2019 06:27
-
-
Save yugarinn/d9324c7e66ed7f093a000b4237b06b68 to your computer and use it in GitHub Desktop.
ternary operator
This file contains hidden or 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
| // NO? | |
| validator.isValid() | |
| ? (this.status = Statuses.Valid) | |
| : (this.status = Statuses.Invalid); | |
| // YES? | |
| this.status = validator.isValid() | |
| ? Statuses.Valid | |
| : Statuses.Invalid; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment