Language concepts

setImmediate()

Try the free JavaScript compiler

Node host function scheduling a callback in the check phase after polling. Relative order against timers depends on the scheduling context; not a portable browser API.

Formal Syntax & Structure

javascript syntaxjavascript
setImmediate(callback, ...args)

Parameters & Attributes

NameTypeDescription
callbackfunctionCallback to schedule.
argsany[]Arguments forwarded to callback.

Return Value

Immediate

Node handle usable with clearImmediate.

Working Example

Example Snippetjavascript
setImmediate(()=>console.log("immediate")); console.log("sync");
JavaScript Reference