Skip to main content

Matt Smith

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

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

1 min read
5007 views

One piece of JavaScript syntax I’ve come to appreciate is the nullish coalescing (??) operator. It’s one of those features that’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...

  • JavaScript

Leveraging “unknown” instead of “any”

1 min read
734 views

One habit I’ve picked up over the years using unknown as a default before any. I still use any occasionally, but I’ve become much more intentional about it. The reason is pretty simple: any opts you out of TypeScript’s type checking. That can be convenient when you’re prototyping or working...

  • TypeScript

CSS fix for 100vh in mobile WebKit

1 min read
248725 views

Not long ago there was some buzz around how WebKit handles 100vh in CSS, essentially ignoring the bottom edge of the browser viewport. Some have suggested not using 100vh, others have come up with different alternatives to work around the problem. In fact, this issue goes further back a few...

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