JSFiddle - React, Tailwind, and code Playground
by Anik Islam Abhi
JavaScript
var items = {
"items": [{
"id": 0,
"categoryId": 0,
"label": "TOTAL EDUCATION",
"total": 739599,
"values": [
451383,
288216
],
"items": [],
"metadataIds": "20006",
"collapsed": true
}, {
"id": 0,
"categoryId": 0,
"label": "TOTAL HIGHWAYS",
"total": 63678,
"values": [
32672,
31006
],
"items": [],
"metadataIds": "20022",
"collapsed": true
}]
}
console.log(items.items.map(function(x) {
var temp = [];
x.values.forEach(function(y) {
temp.push(y);
});
return temp;
}))