There's a one-lined if/else statement (ternary operations), as seen here.
What about the two-lined ones?
e.g.
if (true) console.log("True");
else console.log("False");
edit: The 'normal' / standard if/else statements I see look like this:
if (true) {
console.log("True");
} else {
console.log("False");
}
So the difference: No curly brackets.
ifstatement andelsestatement. Orif...elsestatement as a combined term.if/elseon a single line or a conditional operator expression on multiple lines, doesn't change anything.if (bool) satement1;will resolve as if you haveif (bool) { statement1; }- the two are equivalent. The only difference is the coding style. Howeverif (bool) satement1; statement2;will resolve asif (bool) { statement1; } statement2;hence why most styleguides prefer the brackets, since you can more easily modify the block.