Is there any reason why Crockford recommends using the else statement
on the same line as the curly bracet?
if (condition) {
statements
} else {
statements
}
It just looks nicer than:
if(condition){
statements
}
else {
statements
}
plus it ties in the if
and the else
together logically so it's easier to read.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With