Comparisons6

Exercise

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!".

Your code

Result

All exercises · Next: Conditions1 →