loading...

re: There's no "else if" in JS VIEW POST

TOP OF THREAD FULL DISCUSSION
re: There is a golden rule: if statement is always a sign of a design flaw. Period.
 

This is really baffling me. What is the alternative? I don't think programming languages can be Turing complete without some sort of if-statement.

The only realistic way I can interpret your comment is that we should only use switch-statements, but that would just lead to

switch (condition)
{
  case true: ...
}
 

Switch is the way to implement the "else if" construct :)

code of conduct - report abuse