Show notes
Hey friends. So today I wanted to talk about looping over a raise and stuff
like that. And pretty much I'm mostly want to talk about for loops. Earlyon in my software developer career that's pretty much exclusively how Ilooked over things and I learned about filter and map and reduced and allof those things and for each and all that and I went full in on that stuff.More recently, I've been getting into using four of loops for stuff. And I
find that to work out really nicely.To the point where I don't think you'llever ever catch me use a for each on an array anymore I and like I can'tthink of a scenario where that would be more simple than just doing a fourof loop.With potentially the exception of you've got a function over here already
to find and you're just gonna pass it as the argument to for each. Maybethat I guess could make sense but most of the time I'm just gonna be usinga forever. So anyway, I Yeah, I don't really have much more to say aboutthat.It's just kind of.Something interesting to think about and I do have a blog
post actually about using map and filter versus reduce and a regular oldsea style loop where you have the index and everything like that. And soyou could go take a look at that if you're interested in diving littledeeper, it even has an egg-head video on there.But yeah, just look at my blog look for reduce or filter. You'll find it on
there. But yeah, I find myself like early on. I used those sea style loopsand,Then and full on a raise and now I'm kind of yeah between arraymethods, sometimes I'll use reduced but not often I'm mostly on filter andmap.If I really need performance gains of using reduced then I'll go with that
just fine but anyway hope that is interesting and useful and insightful. Ifyou haven't been using four ofs and you've been finding you're using foreach then yeah, go ahead and give a four of trying they're pretty great.Thanks bye.

