Skip to main content

Matt Smith

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

Finally, safe array methods in JavaScript

2 min read
1942 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

Understanding Promise.any(): when one success is enough

2 min read
1204 views

Promises have long been our go-to when working with asynchronous code in JavaScript. If you’ve used Promise.all() or Promise.race() to coordinate async operations, you know the patterns. But what if you’re only interested in the first successful result, ignoring failures? That’s exactly what Promise.any() does: it fulfills with the first...

  • JavaScript

Logical assignment operators in JavaScript: small syntax, big wins

2 min read
7216 views

In day-to-day JavaScript, we often write code that checks a variable before assigning it a new value. These checks can get repetitive, especially when working with component props, global configs, or state objects. That’s where logical assignment operators come in, a compact ES2021 feature that simplifies common conditional assignments without...

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