Created
May 31, 2018 23:10
-
-
Save gladchinda/d20dcdf3b272960379f7ebadd6b10dcb to your computer and use it in GitHub Desktop.
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
| // METHOD 1: Using if/else statements | |
| if (loggedIn) { | |
| showUserProfile(); | |
| } else { | |
| showLoginForm(); | |
| } | |
| // METHOD 2: Using ternary operation | |
| loggedIn ? showUserProfile() : showLoginForm(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment