FrontendInterviews.dev

663. Object.groupBy and toString Output

Easy•

Predict the output.

const items = [{ id: 'a' }, { id: 'b' }]
const groups = Object.groupBy(items, ({ id }) => id)
console.log(items.toString())
console.log(groups.toString())

What is printed in the console?

Select an option and submit your answer.
Next Problem