re: Refactoring the Worst Code I’ve Ever Written VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hey, thanks for the comments! I'm always happy to hear constructive criticism on how to make my code better. :) If I'm understanding you correctl...
 

Re 1, it's not so much where it is but rather that I suspect Array.from loops and new Set loops and the map loops, which means 3 loops for each construction of those items.

That said, you could do it all in one reduce and keep the concerns separated with object keys, and then destructure them into variables in the outer scope.

I think re 3 you're talking about my non-mutation comment?

If you destructure the variables it can be terser, but my case is more for non-destructive operations. I don't like modifying things because it makes the original unavailable for later use without larger refactor. But again I'm an ideologue about this and it isn't common opinion.

code of conduct - report abuse