views:

67

answers:

2
if (//some condition) {
//some code
} else {
//other code
}

or

if (//some condition) {
//some code
}
else {
//other code
}
+4  A: 

I think the first one isn't good, and I have the same feelings about the second one

Harmen
Then what is good syntax?
chromedude
@chromedude I see you updated your question now, but really, this makes no sense. If you prefer to write it with a newline, it's fine, as long as you are consistent. The only thing you need to watch out for is a newline after the `return` keyword, that might return nothing
Harmen
@Harmen ok, thanks. I am relatively new to javascript and I taught what I know to myself so on syntax I have some weird things so I wanted to fix this one if this one was wrong.
chromedude
+3  A: 

Neither. They're both incorrect syntax.

BoltClock