ternary operatör

Ternary operator (?:) ile basit koşullu ifadeler yazabiliriz.

condition ? value1 : value2

Örnek:

let age = 18;
let status = (age >= 18) ? "Adult" : "Minor" // ## Adult

Source: MDN:Conditional (ternary) operator