javascript: Opinion on formatting if else if else block?
I 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”.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 17
I think he meant reviving this discussion thread, not the JS thread
This is addressed with https://github.com/airbnb/javascript#16.2
Sure, will do!