Use a conditional (ternary) operator for this exercise: If the variable firstName is equal to "John", the value of the variable result should be "Hello John!", otherwise the value of result should be "You're not John!". Syntax hint: (condition) ? value1:value2; |
Edit This Code:
Result:
|
Correct Code:
Correct Result:
|