Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

conditional operator ?:

condition ? consequent : alternative

var rand = new Random();
var condition = rand.NextDouble() > 0.5;

var x = condition ? 12 : (int?)null;

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/conditional-operator
 
PREVIOUS NEXT
Tagged: #conditional #operator
ADD COMMENT
Topic
Name
9+2 =