Intermediate JavaScript
Q88 / 100

What is the Object.groupBy() method (ES2024)?

Correct! Well done.

Incorrect.

The correct answer is B) A static method that groups iterable elements into an object based on a key-returning callback

B

Correct Answer

A static method that groups iterable elements into an object based on a key-returning callback

Explanation

Object.groupBy([{type:"a"},{type:"b"},{type:"a"}], x => x.type) returns { a: [...], b: [...] }. Map.groupBy() does the same for Map results.

Progress
88/100