Last active
September 23, 2017 18:20
-
-
Save primaryobjects/5510fbfd003a71c10e39c58a1e7b9442 to your computer and use it in GitHub Desktop.
Which conditional would you write in JavaScript and why?
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
// A | |
if (isActive) | |
doIt(); | |
// B | |
if (isActive) { | |
doIt(); | |
} | |
// C | |
isActive && doIt(); |
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
1. Which is the shortest? | |
2. Which is the easiest to read? | |
3. Which is the easiest to maintain? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment