JSFiddle - React, Tailwind, and code Playground
JavaScript
let tup = [
{
"thumbsup": [
{
"feedback": "thumbsup",
"feedbackMessage": "It was easy to make a payment",
"feedbackAllFlows": [
"map"
]
},
{
"feedback": "thumbsup",
"feedbackMessage": "Fast and simple.",
"feedbackAllFlows": [
"map"
]
},
{
"feedback": "thumbsup",
"feedbackMessage": "Very fast",
"feedbackAllFlows": [
"sales",
"cases"
]
},
{
"feedback": "thumbsup",
"feedbackMessage": "Very easy to use.",
"feedbackAllFlows": [
"off shore"
]
},
{
"feedback": "thumbsup",
"feedbackMessage": "Great help. Once I asked tge correct question",
"feedbackAllFlows": [
"offshore",
"disconnect",
"thanks"
]
},
{
"feedback": "thumbsup",
"feedbackMessage": "Very quick",
"feedbackAllFlows": [
"pay later"
]
},
{
"feedback": "thumbsup",
"feedbackMessage": "improve the billing and help better understanding the bill cycle",
"feedbackAllFlows": [
"pay later",
"high"
]
},
{
"feedback": "thumbsup",
"feedbackMessage": "Everything was simple and easy. Quick responses made the process a lot faster.",
"feedbackAllFlows": [
"activate"
]
},
{
"feedback": "thumbsup",
"feedbackMessage": "Very helpful",
"feedbackAllFlows": [
"pay later"
]
}
]
}
];
var mainArr = [];
tup[0].thumbsup.map(obj => {
//console.log(obj.feedbackAllFlows)
obj.feedbackAllFlows.map ((flow) => {
mainArr.push({flow: obj.feedbackMessage})
})
})
console.log(mainArr)