In the example find is the solution that is the best description for the wanted behavior.
In general, if you "wanted perform some calculations on each item of an array", prefer map (a pure transformation of each object) over imperative for and forEach.
Totally agree . People who start programming, generally they start with the procedural paradigm of programming. for loop is one the first thing that people come across (along with if-else). That sticks to their mind forever , until functional programming is introduced to them . Its just matter of time to get used to such paradigm . I am pretty sure with few weeks, the author of the article will be very well versed in functional programming
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In the example
find
is the solution that is the best description for the wanted behavior.In general, if you "wanted perform some calculations on each item of an array", prefer
map
(a pure transformation of each object) over imperativefor
andforEach
.Totally agree . People who start programming, generally they start with the procedural paradigm of programming.
for loop
is one the first thing that people come across (along with if-else). That sticks to their mind forever , until functional programming is introduced to them . Its just matter of time to get used to such paradigm . I am pretty sure with few weeks, the author of the article will be very well versed in functional programming