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

Most upvoted comments

thread necromancy

I think he meant reviving this discussion thread, not the JS thread

Sure, will do!