Code Editor
The Zen of Ruby

The Ternary Operator

Good! Let's make our code even more streamlined using the ternary operator.

three = 3 puts three == 3 ? "Of course." : "What?" # ==> puts "Of course."

The example above is just a syntax reminder.

Report a Bug
If you see a bug or any other issue with this page, please report it here.