Saturday, July 16, 2016

If Statement, If...Else Statement, and Switch Case as Spoken (Plain Language) vs Code

The if statement is "if conditionA, then resultA".

The if...else statement is "if conditionA, then resultA, else resultB".

The switch case statement is "if it is the case caseA, then resultA; if it is the case caseB, then resultB; ... ; if none of the above, then default result".

The switch statement in plain/spoken language is a series of "if's".

No comments: