Skip to main content
Version: 0.1.2

GlobalThis

The globalThis global object.

Methods

clearTimeout()

clearTimeout(id): void;

Cancel a timeout previously established by calling setTimeout.

Parameters

ParameterTypeDescription

id

number

The ID (integer) which identifies the timer.

Returns

void

Throws

Throws Error if ID is not an integer value.


setTimeout()

setTimeout(
callback,
delay, ...
args?): number;

Set a timer which executes a function or specified piece of code once the timer expires. Also see setTimeout.

Parameters

ParameterTypeDescription

callback

(...args) => void

A function to be executed after the timer expires.

delay

number

The milliseconds that the timer should wait before the function is executed.

...args?

any[]

Additional arguments which are passed through to the function.

Returns

number

The ID (integer) which identifies the timer created.

Throws

Throws Error if callback is not a function value.