Skip to content

A typo in the documentation for Array.prototype.groupBy method #1086

@ndejoma

Description

@ndejoma

Hi @zloirock I was looking at the README.md file

Seems there is a typo in the Array.prototype.groupBy method, in the ReadMe file it is as below:

[1, 2, 3, 4, 5].group(it => it % 2); //  { 1: [1, 3, 5], 0: [2, 4] }

The code above will not work since the group method will be undefined. Also, the null-prototype object group names returned above should be strings and not numbers. I have corrected the above to be:

[1, 2, 3, 4, 5].groupBy(it => it % 2) // { '0': [ 2, 4 ], '1': [ 1, 3, 5 ] }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions