Answers for "javascript join list of objects with lists"

0

javascript join list of objects with lists

// map results in any[][] which is destructured and concatenated
// object: {someBoolean: boolean, objectWithLists: {id: string, list:any[]}[]}
[].concat(...object.listOfObjectsWithListAndId.map(
                            (obj: {id: string, list: any[]}) => obj.list,
                          ),
                        )
Posted by: Guest on September-28-2021

Code answers related to "javascript join list of objects with lists"

Code answers related to "Javascript"

Browse Popular Code Answers by Language