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

javascript.builtins.Array.groupBy - Supported behind flag in Chrome #16436

Closed
Lewiscowles1986 opened this issue May 26, 2022 · 7 comments
Closed
Labels
data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript

Comments

@Lewiscowles1986
Copy link

What type of issue is this?

Missing compatibility data

What information was incorrect, unhelpful, or incomplete?

Compatibility lists as not in chrome... It is in my chrome stable install...

Example

Input

copy(JSON.stringify([{"id":1,"amount":1798,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-02-14T10:40:33.516Z"},{"id":2,"amount":2955,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":3,"amount":7679,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":4,"amount":6757,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":5,"amount":5278,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":6,"amount":6425,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":7,"amount":1024,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":8,"amount":7755,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":9,"amount":3279,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":10,"amount":5323,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":11,"amount":5282,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":12,"amount":6585,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":13,"amount":2208,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":14,"amount":2267,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":15,"amount":5017,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":16,"amount":1000,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":17,"amount":1739,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":18,"amount":6869,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":19,"amount":9962,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":20,"amount":9100,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":21,"amount":9662,"merchant":"TFL London","category":"Transport","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":22,"amount":9620,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":23,"amount":8037,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":24,"amount":2826,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":25,"amount":9956,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":26,"amount":3312,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":27,"amount":5676,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":28,"amount":80,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":29,"amount":8537,"merchant":"TFL London","category":"Transport","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":30,"amount":5326,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":31,"amount":5364,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":32,"amount":7546,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":33,"amount":569,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":34,"amount":3656,"merchant":"TFL London","category":"Transport","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":35,"amount":470,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":36,"amount":6648,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":37,"amount":1446,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.518Z"},{"id":38,"amount":7751,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-01-14T10:40:33.518Z"},{"id":39,"amount":947,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-01-14T10:40:33.518Z"},{"id":40,"amount":3156,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.518Z"},{"id":41,"amount":4774,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-01-14T10:40:33.518Z"},{"id":42,"amount":6709,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":43,"amount":4639,"merchant":"iTunes","category":"Music","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":44,"amount":1451,"merchant":"TFL London","category":"Transport","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":45,"amount":457,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":46,"amount":5161,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":47,"amount":5851,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":48,"amount":7411,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":49,"amount":5770,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":50,"amount":1771,"merchant":"TFL London","category":"Transport","paymentDate":"2019-02-10T10:40:33.518Z"}].groupBy(({category}) => category)))

Output

{"Groceries":[{"id":1,"amount":1798,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-02-14T10:40:33.516Z"},{"id":2,"amount":2955,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":6,"amount":6425,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":7,"amount":1024,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":8,"amount":7755,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":11,"amount":5282,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":20,"amount":9100,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":24,"amount":2826,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":27,"amount":5676,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":28,"amount":80,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":35,"amount":470,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":38,"amount":7751,"merchant":"Tescos Ltd","category":"Groceries","paymentDate":"2019-01-14T10:40:33.518Z"},{"id":39,"amount":947,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-01-14T10:40:33.518Z"},{"id":41,"amount":4774,"merchant":"Sainsburys","category":"Groceries","paymentDate":"2019-01-14T10:40:33.518Z"}],"Eating Out":[{"id":3,"amount":7679,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":4,"amount":6757,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":9,"amount":3279,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":10,"amount":5323,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":13,"amount":2208,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":15,"amount":5017,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":16,"amount":1000,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":17,"amount":1739,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":25,"amount":9956,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":30,"amount":5326,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":32,"amount":7546,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":37,"amount":1446,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-01-14T10:40:33.518Z"},{"id":47,"amount":5851,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":48,"amount":7411,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":49,"amount":5770,"merchant":"Pret Ltd","category":"Eating Out","paymentDate":"2019-02-10T10:40:33.518Z"}],"Shopping":[{"id":5,"amount":5278,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-02-14T10:40:33.517Z"},{"id":22,"amount":9620,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":23,"amount":8037,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":33,"amount":569,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":42,"amount":6709,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":45,"amount":457,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":46,"amount":5161,"merchant":"Amazon","category":"Shopping","paymentDate":"2019-02-10T10:40:33.518Z"}],"Music":[{"id":12,"amount":6585,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":14,"amount":2267,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":18,"amount":6869,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":19,"amount":9962,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":26,"amount":3312,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":31,"amount":5364,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":36,"amount":6648,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":40,"amount":3156,"merchant":"iTunes","category":"Music","paymentDate":"2019-01-14T10:40:33.518Z"},{"id":43,"amount":4639,"merchant":"iTunes","category":"Music","paymentDate":"2019-02-10T10:40:33.518Z"}],"Transport":[{"id":21,"amount":9662,"merchant":"TFL London","category":"Transport","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":29,"amount":8537,"merchant":"TFL London","category":"Transport","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":34,"amount":3656,"merchant":"TFL London","category":"Transport","paymentDate":"2019-01-14T10:40:33.517Z"},{"id":44,"amount":1451,"merchant":"TFL London","category":"Transport","paymentDate":"2019-02-10T10:40:33.518Z"},{"id":50,"amount":1771,"merchant":"TFL London","category":"Transport","paymentDate":"2019-02-10T10:40:33.518Z"}]}

What browsers does this problem apply to, if applicable?

Chromium (Chrome, Edge 79+, Opera, Samsung Internet)

What did you expect to see?

At least partial support

Did you test this? If so, how?

Please see issue description. I pasted the input into the console, and then pasted the output (because the input command also copies to clipboard the result)

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/groupBy

Do you have anything more you want to share?

Version 101.0.4951.67 (Official Build) (64-bit) Windows

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/groupBy

MDN metadata

MDN page report details
  • Query: javascript.builtins.Array.groupBy
  • Report started: 2022-05-26T06:13:59.242Z
@zloirock
Copy link

It's not supported by V8 / Chrome and, most likely, will never be supported.

image

@queengooborg queengooborg added the data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript label May 26, 2022
@queengooborg
Copy link
Collaborator

Chrome doesn't have support for this feature. Most likely, you ran the test on a page that included a polyfill to add the functionality (or less likely, an extension is loading the polyfill).

@queengooborg queengooborg closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2022
@queengooborg queengooborg added invalid 🚫 Invalid issues or pull requests (wrong repo, spam, duplicates, etc.). This won't get merged. Sorry! and removed needs triage 🔎 labels May 26, 2022
@Lewiscowles1986
Copy link
Author

Lewiscowles1986 commented May 26, 2022

I ran it on a page that was fetching JSON REST API output...

image

How do I disable all browser plugins / run without them to test that theory?

image

@Lewiscowles1986
Copy link
Author

Right this is chrome://flags/#enable-javascript-harmony not an extension. It's built into chrome flags and is just not the default Chrome experience. So again your compatibility chart is wrong.

@queengooborg
Copy link
Collaborator

Ah okay, so it's hidden behind a flag, not actually supported by default. I'd welcome a pull request to add the flag support data into BCD, if you're down to research the version numbers!

@queengooborg queengooborg changed the title javascript.builtins.Array.groupBy - compatibility lists as not in chrome... It is in chrome javascript.builtins.Array.groupBy - Supported behind flag in Chrome May 27, 2022
@queengooborg queengooborg reopened this May 27, 2022
@queengooborg queengooborg removed the invalid 🚫 Invalid issues or pull requests (wrong repo, spam, duplicates, etc.). This won't get merged. Sorry! label May 27, 2022
@Lewiscowles1986
Copy link
Author

Would you be able to expand upon or link to content that explains

I'd welcome a pull request to add the flag support data into BCD, if you're down to research the version numbers!

I'll of course be open to installing former versions of chrome.

@zloirock
Copy link

Most likely, the method will be renamed in 2 weeks, so I'm not sure that it's required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:js 📟 Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript
Projects
None yet
Development

No branches or pull requests

3 participants