Skip to content
Tech Dictionary
DictionaryThe dataContribute
Dictionary/Programming
CodeBeginner

Conditional

Also known as if statement · branching

Code that chooses what to do based on whether a condition is true.

Think of it this way

The fork in the road, minus the dramatic movie soundtrack.

In the real world

If the cart is empty, hide the checkout button.

One thing to remember

Several conditions can overlap; their order may matter.

Related

BooleanLoop

Go a little deeper

  • Python language tutorial (opens in a new tab)
  • MDN Glossary (opens in a new tab)
Improve this entry

What do we build for, if not to lessen each other’s hardship?

Tech Dictionary