I'm struggling with a JSON object that looks like this:
const people = {
name: 'My Name',
cities: [{city: 'London', country: 'UK'},{city: 'Mumbai', country: 'IN'},{city: 'New York', country: 'US'}],
}
What I need is the output to be formatted like this: each city flattened into an array.
[
['My Name', 'London', 'UK'],
['My Name','Mumbai', 'IN'],
['My Name','New York', 'US']
]
I've tried using flatten without success. Can someone please assist me with this? Thanks, Sasi