JavaScript question detail
What are the pros and cons of for loops
The for-loop is a commonly used iteration syntax in javascript. It has both pros and cons
Pros
- Works on every environment
- You can use break and continue flow control statements
Cons
- Too verbose
- Imperative
- You might face off-by-one errors.