Skip to main content

Matt Smith

  • About
  • Contact
Web Dev | Front-End Engineer | UX Designer

How to group arrays in JavaScript without reduce()

2 min read
0 views

Front-end developers frequently transform arrays: filtering, mapping, reducing. And sometimes grouping. Grouping used to require custom reduce() logic, which often felt like more boilerplate than it was worth. But that’s changing. JavaScript now has native support for grouping data with Object.groupBy() and Map.groupBy(). These static methods make grouping expressive, concise,...

  • JavaScript

Stop using .reverse().find(): meet findLast()

2 min read
3613 views

If you’ve ever needed to search an array from the end, you’ve probably reached for a combination of .slice().reverse().find(...), or looped backward manually. It works, but it’s not an elegant solution. We now have a better way: Array.prototype.findLast() and Array.prototype.findLastIndex(). These features let you search arrays from the end without...

  • JavaScript
  • React

Finally, safe array methods in JavaScript

2 min read
6094 views

There’s a good reason that many developers pause before using .sort(), .reverse(), or .splice() in JavaScript: those methods mutate the original array. That single side effect can lead to subtle, hard-to-trace bugs, especially in apps with shared or reactive state. The good news is that in the last couple of...

  • JavaScript
  • React
Older posts
Twitter
LinkedIn
GitHub
CodePen
© 2025 Matt Smith. All rights reserved.