Skip to main content

Matt Smith

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

Logical assignment operators in JavaScript: small syntax, big wins

2 min read

In day-to-day JavaScript, we often check a variable before assigning it a new value, and it gets repetitive with component props, global configs, and state objects. Logical assignment operators (ES2021) shorten that without changing the logic. What are logical assignment operators? Logical assignment operators combine a logical operator (||, &&,...

  • JavaScript

Modern async iteration in JavaScript with Array.fromAsync()

2 min read

Front-end work involves a lot of asynchronous data: API responses, streams, lazy-loaded content. JavaScript has long had tools for async logic, but working with async iterables has often meant verbose, manual handling. Array.fromAsync() is a newer addition that turns async data sources into arrays, and it works with async/await the...

  • JavaScript

Default parameters: your code just got smarter

2 min read

Optional function arguments come up constantly, whether it’s UI components, API calls, or utility functions. The old way was an if statement or a logical OR to set a default, and that can lead to subtle bugs. How often have you written code like this? function greet(name) { name =...

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