Does C# have something like the JavaScript if or value syntax?
For example, I know you can do this in JavaScript:
var test = someValue || thisValue;
if someValue is undefined, false, or empty string, then test becomes thisValue. However, I’ve never seen a way to do this in C# other than a traditional if, or inline if.
NullCoalesce
However, C# doesn’t do weird JavaScript falsey behaviors.
The short circuit evaluation in C# is more pertinent in evaulating bools: