JavaScript groupBy method now available

Finally! Object.groupBy is fully available! 🚀 Stop using reduce() to group by properties and start using this native method. It’s cleaner, more readable, and officially part of the JavaScript ecosystem. #JavaScript #WebDev #Coding #Frontend #Programming #ES2024

  • text

That's cool, but the majority of us are going to use reduce anyway 😃

Do you know how fast it is compared to other methods to achieve same outcome? I was curious and wrote an article about it 🤓 https://medium.com/@mezenok/how-to-fast-groupby-in-js-using-object-groupby-5cb871a7166d

Worth mentioning on Safari it is Array.prototype.groupToMap

Does TypeScript properly validate Object.groupBy now? A few weeks ago it was still causing a type error.”

Like
Reply

what about old browser supporting?

Like
Reply

Love the readability. Just a quick note: make sure your target browsers/Node version support it (or ship a polyfill), otherwise reduce still wins on compatibility.

Me parece buena idea conectar en LinkedIn, Salvador 🤝🏻 Te parece bien conectar?

See more comments

To view or add a comment, sign in

Explore content categories