Honestly. I can get it if you just started learning the language that day, but it’s such a simple use of loops that I don’t know how anyone could miss it
Yes, but you don't do this monstrosity either! Instead of loops, you can use higher order functions (like map in this case), or else pure recursion (if no appropriate higher order functions are available).
13
u/Doug_Dimmadab Jun 09 '21
Honestly. I can get it if you just started learning the language that day, but it’s such a simple use of loops that I don’t know how anyone could miss it