One of the most powerful tools that all programming languages provide is the ability conditionally run code, creating branches of code that runs only when certain conditions are met. In JavaScript, as in many other languages, this is called conditionals.
Full article