Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Hayden Lee](https://secure.gravatar.com/avatar/81985f2cf9d9f59577c12b4f3efb41b1?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Hayden Lee
1,138 PointsYou shouldn't use loops, use html .map()
loops are for peasents check .map() for arrays and u will see why.
2 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsWhy do you call it "html .map()"?
I don't understand the "html" part.
But while very useful, the array method map doesn't always replace the need for a loop. It depends on what kind of process the loop is performing.
For example, a loop which determines the index of the array item that has the largest value would not be easily replaced using map.
![Hayden Lee](https://secure.gravatar.com/avatar/81985f2cf9d9f59577c12b4f3efb41b1?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Hayden Lee
1,138 Pointsyes
Hayden Lee
1,138 PointsHayden Lee
1,138 Pointsi also get your point
rhupp
11,019 Pointsrhupp
11,019 PointsOff-topic, but I'm pretty sure Steven Parker is a genius. :)
Steven Parker
230,688 PointsSteven Parker
230,688 PointsI'm flattered!
But yea, that's a bit "off-topic'. ![:see_no_evil: :see_no_evil:](https://image-proxy-cdn.teamtreehouse.com/7e2cd972ef43a6ce7020c3a945ab8eae1b163900/68747470733a2f2f7374617469632e7465616d74726565686f7573652e636f6d2f696d616765732f656d6f6a692f756e69636f64652f31663634382e706e67)