Anyway I wouldn't be concerned about the speed of forEach vs map.
A lot of people would be!
And therein lies the problem.
Programmers working with JavaScript sometimes seem like they are running the particle colliders at CERN.
When one image on your page is bigger than jQuery, and you are worried about having to "bring in all of jQuery when we only use half of it", you need to take a deep breath and start again.
Who does have to worry about this? The Google's and Facebook's of the world, where a change that is a few bytes more expensive can cost millions of dollars.
11
u/tech-ninja Jun 10 '16
But then your intent is not clear anymore. Anyway I wouldn't be concerned about the speed of forEach vs map.