condition ? console.log(‘true-sentence’) : console.log(‘false-sentence’)
but the following does seem to work:
console.log(condition ? ‘true-sentence’ : ‘false-sentence’)
The latter is less repetitive and therefore shorter, and it doesn’t ignore the return value of the ternary operator, illustrating why a ternary operator is useful.
Why does the course still prefer (even require) the former?