Q2. How is a forEach statement different from a for statement?
Only a for statement uses a callback function.
A for statement is more generic and can be used with various iterable objects, while a forEach statement is mainly designed for arrays but can also be used with other iterable objects like Sets.