3 ms·
If the language implements them as lazy iteration, then I think take_until would be effectively equivalent to break, with early exiting behavior. List.where(…)
by setr 5y ago
If the language implements them as lazy iteration, then I think take_until would be effectively equivalent to break, with early exiting behavior.
List.where(…).map(…).take_until(…)
- bryanrasmussen 5y agomaybe, but that seems a weird way to say you can do it.
- dragonwriter 5y ago> If the language implements them as lazy iteration JS doesn't, though. > then I think take_until would be effectively equivalent to break JS also doesn't have take_until.
- bryanrasmussen 5y ago>JS also doesn't have take_until. I just assumed it was a new method coming out soon! Although when I was thinking of how I would make a method I just thought an until method that iterated all elements of an array outputting them until it got the return from the callback that was passed as the iteration stopper - default value null.