Introduction
A foreach loop helps you go through each item in a group one by one without worrying about counting or indexes.
When you want to read or use every item in a list of names.
When you need to print all elements in an array of numbers.
When you want to check or change each item in a collection like a list or set.
When you want to add up all values in a collection without missing any.
When you want to avoid mistakes from counting indexes manually.