Javascript provides us with different functions to make our development life easy but if you have worked with Javascript for a little while, you un...
For further actions, you may consider blocking this person and/or reporting abuse
That's a nice article on a topic that needed to be written up (forEach v map).
Very nice that you provided actual reasons for using one or the other. I notice that a lot of people just use map() because it is the newest and shiniest, but forEach() still has its place. ππ½
Thank you for the support :)
Just a quick note here:
forEach is mutable - means he operates with the same piece of memory, allocated for defined array, but giving some CPU resources for restructuring this piece after some changes in loop
map is immutable - means it just allocates new place in memory for your results, where RAM is giving storaging resources and CPU does much less
So there is always a choice if you need to calculate slower but to save some memory, or vice-versa
Great explanation!
Thanksππ½
Thanks! Let me know if there's some topic you want me to cover
Cool explanation.
Thanks! Let me know if there's some topic you want me to cover
Great explanation
Clear explanation. Thanks <3
Thanks! Let me know if there's some topic you want me to cover
Great work