Implementing Python's Context Manager Pattern in JavaScript

from blog Jordan Eldredge's Blog, | ↗ original
↗ original
Python Context Managers are a great way to model resources with setup and teardown. Here's how to implement that pattern in JavaScript.