Skip to content

not operator (anything but) #139

@Mouvedia

Description

@Mouvedia

tl;dr:

(param: Any) => not String
// shorthand
(param: Any) => !String

// union case
(param: Any) => not(String | Array)
// short hand
(param: Any) => !(String | Array)

Sometimes it's way easier and convenient to define the type by discarding one or several.
There's also the possibility to define it as a substraction—e.g. Any - String—but that would not be very conventional.

TypeScript approaches

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions