Question: How is a forEach statement different from a for statement?
- Only a for statement uses a callback function.
- A for statement is generic, but a forEach statement can be used only with an array.
- Only a forEach statement lets you specify your own iterator.
- A forEach statement is generic, but a for statement can be used only with an array.
Answer: The correct answer of the above question is Option B:A for statement is generic, but a forEach statement can be used only with an array.