Opinion on formatting if else if else block?
See original GitHub issueI know what I would choose but I thought I would mention it here. What’s the style guide for if else if else formatting.
if (condition) {
//stuff
} else {
//stuff
}
vs
if (condition) {
//stuff
}
else {
//stuff
}
I think the choice is obvious but, “I’ve heard it both ways”.
Issue Analytics
- State:
- Created 9 years ago
- Comments:17
Top Results From Across the Web
Formatting of if Statements - Stack Overflow
I find this: if( true ) { DoSomething(); } else { DoSomethingElse(); }. better than this: if( true ) DoSomething(); else DoSomethingElse();. This...
Read more >Using Conditional Formatting: If Statements in Excel
The answer is yes and no. Any conditional formatting argument must generate a TRUE result, meaning that at a literal level, your conditional...
Read more >How to Combine Conditional Formatting with an IF Statement
One of the methods to achieve Conditional formatting based on a custom formula is using the IF statement. The IF function works on...
Read more >if / else errors - learn how to fix these - Codecademy
First off, a quick review of what if statements look like. Depending on what you are checking for, the else if and else...
Read more >C - if...else statement - Tutorialspoint
C - if...else statement, An if statement can be followed by an optional else statement, which executes when the Boolean expression is false....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think he meant reviving this discussion thread, not the JS thread
This is addressed with https://github.com/airbnb/javascript#16.2