Just another developer trying to get his tests fast, his features to add value and his bloody code to compile! Lately I've been enjoying writing about the best way to release software!
Hello @dylanwatsonsoftware , I'm new with JS. I'm really curious about why you horrified, may you give me the best solution for this simple case? Thanks!!
Just another developer trying to get his tests fast, his features to add value and his bloody code to compile! Lately I've been enjoying writing about the best way to release software!
I think in practice, I'd be horrified if someone tried to use a reduce over a simple for..of for such a simple case but it was a good article. Thanks!
Hello @dylanwatsonsoftware , I'm new with JS. I'm really curious about why you horrified, may you give me the best solution for this simple case? Thanks!!
Hmm just rereading the article. The example I was referring to is:
But you could write it much more simply, something like:
Some cases you might need the first one... But usually the 2nd one is much easier to read, which means it's less likely to contain a bug.
Thank you, the 2nd is easy for me to understand, actually it took me a while to understand why the first one can run.