I suggest you ...

Add unary ternary operator

Hi,

I'd like to ask you to allow omitting the last argument of the ternary operator, like the follows:

var checked = flag ? "checked";

Instead of:

var checked = flag ? "checked" : (string)null;

This might be very useful in Razor engine, for adding classes like .active etc.

16 votes
Vote
Sign in
(thinking…)
Password icon
Signed in as (Sign out)
You have left! (?) (thinking…)
shimmy shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base