Skip to content

Proposal: syntax sugar for binary compare expressions #2903

@tinganho

Description

@tinganho

Auto referring to last identifier:

Instead of:

if(value > 2 && value !== 3) {}

we can have this:

if(value > 2 && !== 3) {}

Auto referring to last identifier and operator:

Instead of:

if(value === 2 && value === 3) {}

we can have this:

if(value === 2 && 3) {}

Range comparisons:

for numbers:

if(value === 1..3) {}

for enums:

if(value === Enum.something...Enum.somethingElse) {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions