Control Flow
Conditional Statements
If / else
if (condition)
// Statement
else if (anotherCondition)
{
// Another statement
}
else
{
// Yet another statement
}Switch / case
switch(variable)
{
case "A":
case "B":
// Do something
break;
case "C":
// Do something
break;
default:
// Do something
break;
}Conditional operator
Iteration Statements
For loops
Foreach loops
While loops
Do-while loops
Break and continue
Last updated