Skip to content

Cannot perform arithmetic on Dates #9356

Closed
@bcherny

Description

@bcherny
new Date() - new Date()
// [ts] The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.

JS will implicitly convert these to numbers via valueOf, so explicit conversion is not necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions