Simple Switch With Break

suggest change

The break keyword can be used in switch statements to exit the statement before evaluating all conditions.

Example:

switch('Condition')
{
  'Condition'
  {
    'First Action'
  }
  'Condition'
  {
    'Second Action'
    break
  }
  'Condition'
  {
    'Third Action'
  }
}

Output:

First Action
Second Action

Because of the break keyword in the second action, the third condition is not evaluated.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents