I empower people to become software developers, especially those with kids/family responsibilities, full-time jobs, or who feel too old to start over. 🥰👩🏽💻
Location
Washington DC
Education
Duke University | The Firehose Project (coding bootcamp)
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.
Wondering why you didn't use
[12,3,44,5].find
function for the same ?What I'm loving about this thread is reading all the ways to accomplish my coding goal 😊 Thanks so much for your suggestion.
Because of this reason I joined dev.to recently .
Back to the arrays discussion, the trend of using for loop will go away.
For every use case there must be some array function available.
w3schools.com/jsref/jsref_obj_arra...
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