Red Hat Interview Question

When/where would you use a "foreach loop" rather than a "for" loop in JS and why?