0👍
✅
You can map
through the array and return a modified version.
var items_extended = items.map(function (item) {
return {
id: item.id,
name: item.name,
category: item.category.name,
};
});
Source:stackexchange.com