Learn

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.

Instructions

1.

Refactor the if statement in the editor to use a ternary operator to puts the correct sentence.

Take this course for free

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.

Already have an account?