Skip to main content

Matt Smith

  • About
  • Elsewhere
Modern Web Engineering, Front-End First

The power of the spread and rest syntax in JavaScript

2 min read

It’s a fair bet that most web developers regularly encounter the three dots (...) in their code. Sometimes it magically copies arrays, sometimes it gathers up function arguments, and sometimes it shows up in object literals like it’s casting a spell. These are the spread syntax and the rest parameter....

  • JavaScript
  • React

When to use map() vs. forEach()

1 min read

I saw this post on Reddit about a JavaScript coding assessment and it got me thinking about map() and forEach(). They look similar, but they do different jobs. Here’s how I think about it, and why I usually go with map() when I’m transforming data. What’s map()? The map() method...

  • JavaScript

Mastering default values in JavaScript with the nullish coalescing (??) operator

1 min read

One piece of JavaScript syntax I’ve come to appreciate is the nullish coalescing (??) operator. It’s easy to overlook until it saves you from a subtle bug. If you’re still using the logical OR (||) operator to provide default values, it’s worth knowing where the two behave differently. What each...

  • JavaScript
Older posts Newer posts
GitHub
LinkedIn
CodePen
RSS
© 2026 Matt Smith. All rights reserved.