function pivotTable(table) { const map = new Map(); table.forEach(row => { map.set(row.key, row.value); }) return map }