Skip to main content

Matt Smith

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

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

April 10, 2025
1 min read
4331 views

One important piece of JavaScript syntax that I’ve enjoyed using is the nullish coalescing (??) operator. The ?? operator handles default values more effectively compared with the traditional approach using the logical OR (||) operator. It’s a 100% must-have tip. Both the ?? and || operators return the right-hand operand...

  • JavaScript

Leveraging “unknown” instead of “any”

March 31, 2025
1 min read
612 views

In TypeScript, you may have heard that the any type is seen as a kind of “get out of jail free” card. It allows any value to be assigned to a variable of type any, which effectively disabling TypeScript’s static type checking. That might be convenient in certain situations, but...

  • TypeScript

CSS fix for 100vh in mobile WebKit

May 11, 2020
1 min read
243896 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
Newer posts Older posts
Twitter
LinkedIn
GitHub
CodePen
© 2025 Matt Smith. All rights reserved.