isDestroyed()
Prebuilt
Custom
Returns true if destroy() has been called on this instance. A destroyed instance cannot be reused.
A call instance can be reused across multiple calls — a sequence of join(), leave(), join() works as expected. Only call destroy() when you are completely done with the instance and want to free all associated resources.
Calling any method on a destroyed instance throws an Error.
Return value
Returns boolean.
Example
if (!call.isDestroyed()) {
await call.destroy();
}
See also