No matter the programming language, you always need a way to select between executing two different sections of code, depending on some condition. These are called conditionals, and they are what breathe dynamic life into our programming. Here we look at the most common type of conditional, IF… THEN… ELSE…
If/Then/Else is a conditional that lets us ask some question, and depending on if it resolves to be true or false, we can make a section of code be executed. There’s a number of ways If/Then/Else can be written, but despite the syntax, it always works the same way.
In this series the basis of our examples are off two different programming languages, PHP and Javascript, but the principles can often apply to any other programming language.