Explicit resource management in JavaScript
Writing JavaScript that opens something (a file, a stream, a lock, a database connection) also means remembering to clean it up. And if we’re being honest, that cleanup doesn’t always happen. I know I’ve missed it more than once. JavaScript has always made this our problem. We reach for try...