The ternary operator (?:) takes the following form:
condition ? value if true : value if false
A simple example is
($grade >= 50 ? ‘Passed’ : ‘Failed’)
The ternary operator (?:) takes the following form:
condition ? value if true : value if false
A simple example is
($grade >= 50 ? ‘Passed’ : ‘Failed’)