2 ms·
forEach is a loop, so this doesn't answer the basic question OP presented.
by deaddodo 7y ago
forEach is a loop, so this doesn't answer the basic question OP presented.
- dan-robertson 7y agoThe standard doesn’t specify whether or not forEach is a “loop” or not. One could implement it using tail recursion. FWIW I would claim that such recursion should also be called a loop, because the control flow goes in a loop.
- deaddodo 7y agoYou're splitting hairs. I think we can both agree that no implementation does it as such. And if you're going to go to that low of a level, there's no such thing as a loop beyond emergent behavior (they're all conditional branches/jumps).