You are viewing a single thread.
View all comments View context
4 points
*

Are you sure?

Your C# example:

var output = input switch
{
    null    => "Null",
    0       => "Zero",
    > 0     => "Positive",
    _       => "Negative"
};

JS proposal for match:

const output = match input {
    when null:    "Null";
    when 0:       "Zero";
    if input > 0: "Positive";
    default:      "Negative";
}
permalink
report
parent
reply
1 point

Aha, yeah, I see it now. Looking forward to it.

permalink
report
parent
reply

Community stats

  • 1

    Monthly active users

  • 47

    Posts

  • 25

    Comments