What is the purpose of the Array.prototype.forEach method?
Instruction: Explain how the forEach method works and provide an example of when it would be used.
Context: This question evaluates the candidate's familiarity with array iteration methods, an essential skill for manipulating collections of data in JavaScript.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
Let me clarify this with an example for better understanding...