Hi js experts, I hope someone can help me to figure out this one, I need to create new array with (“data” and “title”) where data is parent and title is child from .json. It works for first params “data” (assetId, customerIdentifier) but the trick is I can’t figure out how to push child “title” as second params.
.json sample
{
“assetId”: {
“title”: “id”,
“isVisible”: false,
“order”: 0
},
“customerIdentifier”: {
“title”: “name”,
“isVisible”: true,
“order”: 1
}
}
Object.entries(testDT).forEach(([key, value]) => columns.push({ data: key, title: key.title }));
current output: ( data: assetId, title: undefined )
expected output: ( data: assetId, title: id )
Thank you in advance!