children.BallAdequacy is an array of objects.Inside that playerRank is an array of objects. From each playerRank array I need to display Ball and playerHeight value seprately in console. I used map and filter methods but still I am not able to print the ball and playerHeight for each object. Can you tell me how to fix it. Providing my code snippet and data below
example for each object it should print 222--->HEIGHT,ww22w22--->HEIGHT, etc
let children = {
BallAdequacy: [{
"flight": "dd",
"specialty": "ff",
"playerRank": [{
"Ball": "222",
"playerHeight": "HEIGHT"
},
{
"Ball": "ddeeeew",
"playerHeight": "NON-HEIGHT"
},
],
"hospitalPrivilege": []
},
{
"flight": "kkk",
"specialty": "ff",
"playerRank": [{
"Ball": "kfkf",
"playerHeight": "HEIGHT"
},
{
"Ball": "All",
"playerHeight": "NON-HEIGHT"
}
],
"hospitalPrivilege": []
}
]
};
children.BallAdequacy.map(status => {
console.log("status.playerRank--->", status.playerRank);
status.playerRank.filter(game => {
//console.log("game.playerHeight--->", game.playerHeight);
if (game.playerHeight === 'HEIGHT') {
console.log("after if --->", game);
console.log("after if --->", game.Ball);
}
// (game.playerHeight === 'HEIGHT')
//console.log("outsidei f--->", game);
});
console.log("after filter status.playerRank--->", status.playerRank);
//BallList = getBalls(status.playerRank);
});