Explicit resource management in JavaScript

Author photo beside the headline “Explicit resource management in JavaScript”, with code snippets and an arrow connecting them.

Matt Smith breaks down the new using and await using declarations, plus Symbol.dispose and Symbol.asyncDispose, so cleanup happens automatically at scope exit, in reverse order for stacked resources. He also notes DisposableStack and AsyncDisposableStack for conditional lifetimes.

allthingssmitty.com/2026/02/02/explicit-resource-management-in-javascript