With the ternary operator the expression (in this case a> b or a===b) is either true or false. If its true, the first value before the colon is returned, if false the second value.
So by saying return a > b ? “a is greater” : “b is greater”, either one of the strings is returned, but never both.
Its the same as saying:
if (a > b) { return 'a is greater' } else { return 'b is greater' }