i have an array structure like below, which has combinedPorts as key with nested array. i can able to iterate and display the properties with .map function in ES6 if all the object has same number of combinedPorts key. But here in the first object the combinedPorts array appears three time whereas in second object the combinedPorts array appears twice. How to iterate the combinedPorts key if it appears different from one object to other.
[
{
"name": "Test Source",
"combinedPorts": [
{
"name": "PortGroup_1",
"templateId": "edfb5b72ec580b129465ea0e8029bad3",
"type": "SourcePorts",
"combinedPorts": [
{
"name": "Source_1",
"templateId": "2355fc02e18cd48c6b487aa8b6f75959",
"type": "SourcePorts",
"combinedPorts": [
{
"name": "Sami_TestSource",
"templateId": "0007ad49ea9b02b309a1248592a01981",
"type": "SourcePorts"
},
],
}
],
}
],
"portGroupInfo": []
},
{
"name": "Test Source",
"combinedPorts": [
{
"name": "PortGroup_1",
"templateId": "edfb5b72ec580b129465ea0e8029bad3",
"type": "SourcePorts",
"combinedPorts": [
{
"name": "Source_1",
"templateId": "2355fc02e18cd48c6b487aa8b6f75959",
"type": "SourcePorts"
}
],
}
],
"portGroupInfo": []
}
]
can someone guide me achieve this using ES6. Thanks in advance.