Skip to content

Inconsistent signatures for alert() vs prompt()/confirm() #1626

Closed
@Gaelan

Description

@Gaelan

Currently, we have:

declare function alert(message?: any): void;
declare function prompt(message?: string, _default?: string): string | null;
declare function confirm(message?: string): boolean;

Presumably alert is typed as taking any because it accepts input of any type and implicitly casts it to a string. However, testing in Chrome, Safari, and Firefox, prompt and confirm both do the same thing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions