In my experience though, for every one elegant solution like yours, there will be ten developers writing nested for loops.
My example was never meant to be “look at what Clojure can do! You should all be jealous! “. Only an example of how Clojure encourages a different approach to solving problems that we are all familiar with.
You could simply implement the exact same functions in other languages too and end up with similar code, butsince its not built in, most people won’t think in those abstractions.
Ain't that the forever truth =/
nested for loops go brrrrrr
I think you would need something like this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
but I found it quite mind-bending when I tried it once. Clojure's way of building something like this out of a `lazy-seq` call feels simpler to me...
I, too, find the Clojure version to be easier to read, but I spend more time with Clojure than JS.