Skip to content

lexical this is mentioned but the associated example doesn't demonstrate it #43441

@HeladoDeBrownie

Description

@HeladoDeBrownie

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Window/setInterval

What specific section or headline is this issue about?

#functions_are_called_with_the_global_this

What information was incorrect, unhelpful, or incomplete?

This text:

You can use arrow functions to adopt the this of the function in which setTimeout() is called (arrow functions have a lexical this).

You can test this with the following code.

is followed by an example that doesn't demonstrate what's claimed. It does work around the problem the section is talking about, but the arrow functions in the example could be replaced with function expressions and the behavior wouldn't change, because lexical this isn't used.

What did you expect to see?

Either the text shouldn't imply the example uses a special feature of arrow functions, or the example should demonstrate that feature.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details

Metadata

Metadata

Assignees

No one assigned

    Labels

    Content:WebAPIWeb API docshelp wantedIf you know something about this topic, we would love your help!

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions