Closed as not planned
Description
This isn't possible. Each key of grouped
and its value must exist:
const grouped = Object.groupBy(
[
{
name: "foo",
value: 20,
},
{
name: "bar",
value: 60,
},
{
name: "bar",
value: 40,
}
],
({name}) => name,
);
for (const group of Object.values(grouped)) {
group.forEach(console.log)
// 'group' is possibly 'undefined'.(18048)
}
Additional comments may be found on microsoft/TypeScript#47171 (comment)
Metadata
Metadata
Assignees
Labels
No labels