The terminate()
method of the Worker
interface immediately terminates the Worker
. This does not offer the worker an opportunity to finish its operations; it is simply stopped at once.
Syntax
myWorker.terminate();
Parameters
None.
Returns
Void.
Example
The following code snippet shows creation of a Worker
object using the Worker()
constructor, which is then immediately terminated.
var myWorker = new Worker('worker.js'); myWorker.terminate();
Specifications
Specification | Status | Comment |
---|---|---|
WHATWG HTML Living Standard The definition of 'Worker.terminate()' in that specification. |
Living Standard |
Browser compatibility
See also
The Worker
interface it belongs to.
Document Tags and Contributors
Tags:
Contributors to this page:
DomenicDenicola,
erikadoyle,
pallxk,
nmve,
teoli,
jean-pierre.gay,
chrisdavidmills,
kscarfone
Last updated by:
DomenicDenicola,