Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • The function flat adds overhead in this approach. Commented Feb 10, 2020 at 11:31
  • That's true, any reiteration over the data source does that. Originally the user, just asked about how to "flat" the array and as he kept the question but added a "second step" I updated my original answer too. Commented Feb 10, 2020 at 11:39
  • 1
    Got it, you kept it that way just to let it know how to use the function flat. Commented Feb 10, 2020 at 11:41