Apologies, when I say “do this,” I didn’t strictly mean that you had to use multiple
for loops, and there are certainly many different ways you could implement it using for loops or a combination of
for loops and other array operations. The main point here was to show off the power of some other array operators, particularly
I wouldn’t say it _worries_ me exactly, but it is something to keep in mind if you are experiencing performance problems in a particular place. I think that this is one of those instances where front-loading a performance optimization may not be worth it unless you know for a fact you’re going to be dealing with very large data sets consistently. In…
Thanks, I really appreciate this feedback, especially with all of the other responses including accusations of bias (it is biased in that a lot of it is based on my personal knowledge and experience).
Hmm, that’s bad… You might want to see the final section of the original article: See “I’ve already run… help!” from my original version of this article: https://medium.com/@ExplosionPills/dont-use-sudo-with-npm-5711d2726aa3#4b7c
I didn’t mean to say anything that would make you stop reading, and I never meant to explicitly make a conclusion that using a for loop or iterating was *wrong*, but that being said I would posit that you can reframe the use-cases you’re talking about. For example, if you want to operate on every other item of the array, you could chunk and then map…