Shorthand Syntax
Learn about other ways to write conditional statements.
We'll cover the following
A trailing if
One particularly nice feature in Ruby is that we can append the if
statement
to the code on the if
branch if it’s just a single line. So instead of this:
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy