DEV Community

Discussion on: What’s your alternative solution? Challenge #6

lukaszahradnik profile image
Lukáš Zahradník • Edited on

Well, it is inefficient as well.

In this example the map is just exploited for iterating over elements and completely ignores purpose of the function (transforming array to a new array). It would be better to use forEach or reduce instead.

Thread Thread
13point5 profile image
Bharath Sriraam R R

Good point, thank you!