JavaScript controls program execution using conditional statements and loops, which allow developers to create dynamic and interactive applications. Here's an overview of both.
### Conditional Statements
Conditional statements allow the execution of certain blocks of code based on specified conditions. The primary conditional statements in JavaScript are `if`, `else if`, `else`, and `switch`.
#### Example of `if` Statement
```javascript
let