Type guard to check if an object implements IDisposable.
if (isDisposable(obj)) { obj.dispose(); // safe to call} Copy
if (isDisposable(obj)) { obj.dispose(); // safe to call}
Type guard to check if an object implements IDisposable.