We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

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
HTML Living Standard
The definition of 'Worker.terminate()' in that specification.
Living Standard  

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support4123.51010.64
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support44 Yes411.55.1 Yes

See also

The Worker interface it belongs to.

Document Tags and Contributors

Last updated by: ExE-Boss,