in reply to while/push to map, data structure confusion
Say, while dragonchild answered your question I also see confusion on your part about when to use map. It isn't appropriate now because the end result joins some elements but leaves others separate. Its about what the granularity is. When your "unit" is larger than a single input element to map() then map isn't going to be able to join them for you. The map's focus is on transforming each element into something else for use as a return value. while/fetch's focus is just on getting through to the end and then you do the work of combining things as necessary.
|
|---|