DEV Community

Discussion on: 8 JavaScript Tips & Tricks That No One Teaches 🚀

Collapse
davidsanwald profile image
Info Comment hidden by post author - thread only visible in this permalink
David Sanwald

Map an array without .map()

Pick one. You can't say one is difficult and complicated and nobody will understand it.
And the other one is surprising, rarely taught or known but way easier to understand?

Collapse
garvitmotwani profile image
Garvit Motwani Author

Actually, I really like that method and it is way easier than .map(), that's why I recommended that, but noted! Thanks for reading the article

Collapse
nickjohnmorton profile image
Nick Morton

Please explain how your method is "way easier than .map()"?

I just don't understand your thinking here, the concepts are exactly the same, the syntax is almost exactly the same (actually longer), and you're introducing a somewhat unfamiliar syntax to most to achieve something that everyone likely understands already with .map().

Some comments have been hidden by the post's author - find out more