Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ndejoma opened this issue May 31, 2022 · 1 comment
Closed

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

ndejoma opened this issue May 31, 2022 · 1 comment
Labels

Comments

@ndejoma
Copy link

ndejoma commented May 31, 2022

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 ] }
@zloirock
Copy link
Owner

zloirock commented Jun 1, 2022

Hi. It's not a typo - most likely, it will be renamed soon - #1082 - and seems somehow it left on the master on switching branches. Thanks!

@zloirock zloirock added the docs label Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants