Simple question that I haven't been able to find a simple answer for on the googles: what is the difference between Groovy's each and forEach loops?
I made a simple example and the syntax and behavior seem identical:
[1, 2].each { println it }
[1, 2].forEach { println it }
Both print:
1
2
The only example I see of both in the Groovy Language Documentation seems to touch on the difference between lambdas and closures, but I can't relate that to the examples I've tried.
Thank you