The way of writing code like this is called? solved

return day === ‘Wednesday’ ? true : false ;

SOLVED: It’s called Ternary Operator

general expression is,
Variable= testExpression ? truthyOutput: falsyOutput || Return testExpression ? truthyOutput: falsyOutput

what do you mean with “like this” please?

Sorry, my question was poorly constructed. I think I should have asked “what is this type of conditional operator called?”

do you mean the ... ? ... : ...?

it’s a ternary operator

1 Like