Querying Nested Arrays
To work with tree data structure we need to flatten them.
- We will be solving a problem using
- We will define
- We will solve the same problem using
This post is a follow up post of the
Flatten the movieLists array into an array of video ids
Let's solve with
Flattening trees (2-D) arrays with nested
forEach is relatively straight forward as we add each item explicitly. But this is the behavior which can easily be abstracted.
concatAll()to project and flatten the movieLists into an array of video ids.