A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/Worker/terminate below:

Worker: terminate() method - Web APIs

Worker: terminate() method

Baseline Widely available

Note: This feature is available in Web Workers, except for Service Workers.

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 stopped at once.

Syntax Parameters

None.

Return value

None (undefined).

Examples

The following code snippet shows creation of a Worker object using the Worker() constructor, which is then immediately terminated.

const myWorker = new Worker("worker.js");

myWorker.terminate();

Note: DedicatedWorkers and SharedWorkers can also be stopped from the Worker instance using the DedicatedWorkerGlobalScope.close() or SharedWorkerGlobalScope.close() methods.

Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3