三項演算子 if¶
三項演算子`if`を使うと、`if`文をより短く書くことができます。
a = 1 > 2 ? 3 : 4
# The above is the same as:
a = if 1 > 2
3
else
4
end
三項演算子`if`を使うと、`if`文をより短く書くことができます。
a = 1 > 2 ? 3 : 4
# The above is the same as:
a = if 1 > 2
3
else
4
end