Skip to main content

Control FlowExecution Sequence Order of Statement(s)

Block

Source Code Encapsulate in { } curly braces (excl Object Literals) to define boundary of Lexical Environment

break

JS Keyword to end current loop/switch

Conditional Statement

Control Flow to execute vs boolean condition

continue

JS Keyword to end execution of Statement in current Iteration of loop, & continue execution with next iteration in loop

Guard Clause

Control Flow condition to trigger early return

Iteration

Loop

Control Flow to repeat Block Execution

Recursion

function to call itself from its implementation body

throw

References

  1. Imperative ↔ (Paradigm) to express logic with explicit Control Flow via step-wise instructions

  2. Declarative ↔ (Paradigm) to express logic w/o explicit Control Flow via Abstraction

  3. Conditional StatementControl Flow to execute vs boolean condition

  4. ifControl Flow JS Keyword to optionally execute Block on Boolean Context of expression

  5. whileControl Flow JS Keyword to set condition during which loop continues to execute

  6. do-whileControl Flow JS Keyword to execute once & then check condition whether to repeat

  7. LoopControl Flow to repeat Block Execution

  8. Terminal ConditionControl Flow Condition to break Loop

  9. for-inControl Flow to Loop over iterable INCL ANY AND ALL PROPS !avoid

  10. Inversion of ControlDesign Pattern to invert Control Flow to Callback to increase Modularity & decouple Deps ??

  11. Guard ClauseControl Flow condition to trigger early return