JavaScript Professional — Easy
Key points
- The ternary operator returns the value of `a` if the condition is true
- The ternary operator returns the value of `b` if the condition is false
- It is a shorthand way of writing an if-else statement in JavaScript
Ready to go further?
Related questions
