Im new to javaScript and react..
i have an array consisting of objects. I need to display this array in a AG GRID so what im tring here to map this to array of flat obj.
NOTE: I cannot use jQuery..
below is my array (full code is in codepen, please check the link)
let realData = [
[
{
"key" : "flightNumber" ,
"label": "Flight Number",
"value": "EK 131",
"value-type": "String",
"order" : 1
},
{
"key" : "flightId",
"label": "flightId",
"value": "1223434",
"value-type": "String",
"order" : 2,
"isId": true
},
{
"key": "CallSign",
"label": "callSign",
"value": "123",
"value-type": "String",
"order" : 3
},
]
]
what i want the result is
let newArray = [
{flightNumber: 'EK 131', flightType: 'A', lastUpdate: '11223232', destOrig: 'BEY', sibtSobt: '12121333123', CallSign: '123'},
{flightNumber: 'EK 132', flightType: 'D', lastUpdate: '11334455', destOrig: 'DEST', sibtSobt: '1234443222', CallSign: '443'}
]
please help
Thank you
sibtSobt?