Why use the for loop?
In JavaScript, the for loop is one of the most powerful tools for handling data collections (arrays) or performing repetitive tasks. Unlike other loops, the classic for gives you full control over the index, allowing you to traverse data forwards, backwards, or by skipping elements.
let instead of var inside your loop to avoid scope issues that can cause hard-to-find bugs.