• 3
    Fucking made my shitty day! Redux is my satan 😂😂😂😂
  • 4
    I feel kinda bad for laughing ... but that is funny.

    Someone here posted a list of array iterating and reasons for using the various .forEach() .map() .reduce() and so on. It was pretty handy as honestly I just think of them as loops and ... forget sometimes.
  • 1
    I’m not a fan of reduce, map etc as replacements for for loops bc they make code hard to read to people who are unfamiliar with them. Most programmers are familiar with for loops, as they’re used in most languages out there
  • 7
    @d-fanelli don't see how, if they don't know the function they are either junior needing the knowledge or senior which are outdated so it is time to learn it, if they know them, it is basically telling them why you are iterating over the array.
  • 0
    @N00bPancakes Oo I want that list :) Don't happen to know who posted it?
  • 5
    @d-fanelli people who are unfamiliar with that should learn and adapt. Not the other way around. You should not sacrifice clarity of intent for devs who are unexperienced or unwilling to learn.
  • 4
    @N00bPancakes While forEach() is indeed a loop, it’s better to think of map() and reduce() as data transformations.

    map() transforms a sequence of elements into a sequence of other elements.

    reduce() transforms a sequence of elements into one element.

    They can be implemented as loops but thinking in loops makes it only more complicated.

    And also you can use transformations on streams which do not have a defined end or number of elements.

    You can't do that with loops.
  • 1
    Loved it. I'm in love with reduce.
Add Comment