Condition

Names and abbreviations on this page

MDN — MDN Web Docs (formerly Mozilla Developer Network). Reference material for web programming.

Programming terms & practical skills

What it means

A condition is a test that controls which action a program takes. It is evaluated as true or false, or interpreted that way by the language. Conditional statements make a program respond to different inputs and situations.

Related skills

Write clear rulesState exactly what is being compared.

Check boundariesDecide what happens at equality as well as above or below it.

Cover alternativesHandle the case when the condition is not met.

An everyday example

A reminder can appear when an entered rent amount is greater than the housing budget. Decide separately whether an amount equal to the budget should trigger the same message.

What to check

A rule in software is a chosen assumption, not proof of affordability or eligibility. Explain consequential rules in the interface.

Related learning

Data type

Algorithm

Loop

Learning & Skills

External Resources

MDN — Control flow