Contoh operator bersyarat JS
var age = 19;
var canDrive = age > 16 ? 'yes' : 'no';
Expensive Eagle
var age = 19;
var canDrive = age > 16 ? 'yes' : 'no';
if (x === 5 || x === 7 || x === 10 ||x === 20) {
// run my code
}
bCondition1 && bCondition2
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