Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 181 Bytes

ternary_if.md

File metadata and controls

14 lines (11 loc) · 181 Bytes

Ternary if

The ternary if allows writing an if in a shorter way:

a = 1 > 2 ? 3 : 4

# The above is the same as:
a = if 1 > 2
      3
    else
      4
    end