Combine data from array of objects
From a short review;

Your own answer does read better
map is the right approach
I would go for filter instead of reduce (you only want 'true' values that are not keyword)
I probably would have named total -&gt; keys
I prefer &lt;verb&gt;&lt;object&gt; so combined -&gt; addGroups
If you dont use a falsy comparison, then you dont need to check for 'keyword'



const data = [
    {keyword: 'banana', yellow: true, sweet: true},
    {keyword: 'pineapple', yellow: true, sweet: false},
    {keyword: 'apple', yellow: false, sweet: false},
];

function addGroup(o){
  return {
    ...o,
    group: Object.keys(o).filter(key =&gt; o[key] === true).join(' ') 
  };
}

function addGroups(list){
  return list.map(o =&gt; addGroup(o));
}

console.log(addGroups(data))
.as-console-wrapper { max-height: 100% !important; top: 0; }