Skip to content

error TS2339: Property 'startsWith' does not exist on type 'string' #12383

Closed
@rajinder-yadav

Description

@rajinder-yadav

tsc 2.0.10

Code

let tok = ":name";
if(tok.startsWith(":")) <--- false error: error TS2339: Property 'startsWith' does not exist on type 'string'

// A *self-contained* demonstration of the problem follows...

Expected behavior:
should know this is a method on a JS string.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith

Actual behavior:

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