What does it mean when it says .forEach() returns `undefined`?


#1

Question

What does it mean when it says .forEach() returns undefined?

Answer

Good question! The .forEach() method goes through an array and does something to each array item, but it never returns anything after that. In this case, the undefined means nothing is returned.