The Wayback Machine - https://web.archive.org/web/20250503021350/https://github.com/microsoft/TypeScript/issues/40319
Skip to content

Typings for Array.includes #40319

Closed
Closed
@PuruVJ

Description

@PuruVJ

TypeScript Version: 3.9.7 to 4.0.2

Search Terms: Typescript array includes typings, type, bug

Code:

[].includes

VSCode intellisense as well as the compiler give the error: Property 'includes' does not exist on type 'undefined[]'. The error is on any kind of array.

Expected behavior: Array.includes is a valid property.

Actual behavior: Error: Array.includes does not exists

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions