JSFiddle - React, Tailwind, and code Playground
JavaScript
var items = [
{
"Id":{
"LValue":1,
"Value":1
},
"Date":{
"LValue":"2013-10-17T00:00:00",
"Value":"2013-10-24T00:00:00"
},
"User":{
"LValue":508,
"Value":507
},
"Comments":{
"LValue":"This a test load",
"Value":"This a test"
},
"Name":"John Doe",
"IsDeleted":false
}
];
var flattenedItems = items.map(function(x) {
return {
Id: x.Id.Value,
Date: x.Date.Value,
User: x.User.Value,
Comments: x.Comments.Value,
Name: x.Name,
IsDeleted: x.IsDeleted,
LValues: {
Id: x.Id.LValue,
Date: x.Date.LValue,
User: x.User.LValue,
Comments: x.Comments.LValue,
}
};
});
console.log(flattenedItems);