Skip to main content

Matt Smith

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

Modern async iteration in JavaScript with Array.fromAsync()

July 14, 2025
2 min read
2081 views

As front-end engineers, we frequently deal with asynchronous data, such as API responses, streams, lazy-loaded content, and more. JavaScript has long provided tools for managing async logic, but working with async iterables has often required verbose or manual handling. Enter Array.fromAsync(), a modern addition to JavaScript that simplifies the process...

  • JavaScript

Default parameters: your code just got smarter

June 29, 2025
2 min read
732 views

Whether you’re building UI components, calling APIs, or writing some utility functions, it’s quite common to deal with optional function arguments. Traditionally, you’d fall back on if statements or logical ORs to assign default values. But let’s be honest, that can lead to subtle bugs. How often have you written...

  • JavaScript
  • React

Using await at the top level in ES modules

June 16, 2025
2 min read
4286 views

Writing asynchronous code in JavaScript used to come with a limitation: the await keyword could only be used inside an async function. That changed when ES2022 introduced top-level await, a modern ES module feature that enables new patterns for asynchronous code at the module level. What’s top-level await? Traditionally await...

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