Skip to content

Clarify setImmediate not always run before setTimeout at main module in the learn Asynchronous Work doc #7681

Open
@kekekuli

Description

@kekekuli

Affected URL(s)

https://nodejs.org/en/learn/asynchronous-work/understanding-processnexttick

Description of the problem

In that doc, here is an example code to explain how the nextTick() API affect the execute order. It is right for the nextTick() part. But readers will quickly get messy when they see the output example saying that the setImmediate always have higher order than setTimeout , while both at top-level. The other doc have pointed out that behavior.

So it is better to chang the setimmediate-vs-settimeout part in the example code in that doc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions