JSFiddle - React, Tailwind, and code Playground
by nevkatz
JavaScript
let ch_pairs = [
{
choice:'yes',
summative:'foo'
},
{
choice:'no',
summative:'bar'
}
];
let header_buckets = ch_pairs.map(x => {
x.items = [];
return x;
});
console.log(header_buckets);