JavaScript Control Statements | Conditional & Looping Control Statements

JavaScript  Control Statements also known as Control Structures or Flow Control statements are statements which decide the execution flow of the program. Typically the program execution begins from the first line in the to the last line of that JS code. However, in between this the flow of the execution can be branched(based on some condtion) or re-iterated(loops) based on some criterias. This the functionality that is provided by Control Statements in JavaScript.

They are mainly categorized in 2 types –

  1. Conditional Control Statements
    • Whenever a condition is to be tested depending on which particular tasks are to be performed, Conditional control statements are used.
  2. Looping / Iterative Control Statements
    • Whenever a particular task has to be iterated for a particular number of times or depending on some condition, Looping control statements are used.

Apart from these we have 2 miscellaneous statements as – break and continue which assist in the flow controlling mechanism.

control structures in JavaScript

This was just a theoretical overview of Control Statements in JavaScript and we will see in detail about these individual statements in further tutorials.

Watch it on YouTube

Leave a Reply

Your email address will not be published. Required fields are marked *