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. That cleanup doesn’t always happen. I know I’ve missed it more than once. JavaScript has always made this our problem. We use try / finally, tell ourselves we’ll be...