Skip to content

Instantly share code, notes, and snippets.

@paullj
Created March 21, 2020 00:16
Show Gist options
  • Save paullj/122d9a05630cb4add4d4429f43b04591 to your computer and use it in GitHub Desktop.
Save paullj/122d9a05630cb4add4d4429f43b04591 to your computer and use it in GitHub Desktop.
Mapping problem
fromThis = [
{
name: 'A',
child: {
x: "X",
y: "Y"
}
},
{
name: 'B',
child: {
z: "Z"
}
}
];
toThis = [
{
name: 'A',
child: "X"
},
{
name: 'A',
child: "Y"
},
{
name: 'B',
child: "Z"
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment