Tutorials
THE WORLD'S LARGEST WEB DEVELOPER SITE

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

Syntax hint: (condition) ? value1:value2;