Evaluating Conditional Statements in JavaScript
Too Long; Didn't Read
In JavaScript, we use if / else / else statements to evaluate if a statement is true or false. If a condition is true, it’ll execute a certain action, if it is false, it won’t get inside on this block of code and will move further below to reach the next block. The possibilities of conditions checks are limitless thanks to the use of an else if statement, but too many else if statements may be bad if you end using 100 or more. An alternative to that, which is better when you’re having many cases to check, is to use a switch statement.